Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

NEW FINDING CLIENT UUID USING POWERSHELL SCRIPTING

  • Thread starter Thread starter Gokul
  • Start date Start date
  • Replies Replies 0
  • Views Views 3K

Gokul

Well-Known Member
Staff member
Messages
321
Solutions
4
Reaction score
58
Points
28
Jan 2020 we got some servers from customer side for patching , It was around 600+ servers . We have created separate SUG and pushed to servers . But what happened next ? , we are getting alerting as other servers are getting rebooted which was not belongs to patching schedule . So we have started digging one by one from ground. So we came to know that some servers are having same GUID that is the reason unscheduled servers are getting patched. So that time we have created one PS script to find the GUID of the Clients

What is UUID ?
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems. The term globally unique identifier (GUID) is also used, typically in software created by Microsoft.


Script
This script will check the UUID of the client and append to UUID.csv . Save the below PS in one folder and create one notepad "Servers.txt" , here we can add Clients
SS 1.JPG



Code:
#script direction and input details

$ScriptDir = Split-Path $Script:MyInvocation.MyCommand.Path
$Servers = Get-Content $ScriptDir"\servers.txt"

#getting GUID and appending to UUID.csv

Foreach ($Server in $Servers)
{

Get-WmiObject -ComputerName $Server -Namespace root\CCM -Class CCM_Client | Select PSComputerName, ClientID |Export-Csv "$scriptDir\UUID.csv" -Append -NoTypeInformation

}

OutPut in UUID.csv


SS 1.JPG
 
Last edited:
Back
Top