Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# Define Get Computer GUID Function
# Credit: Johan Åkerström
# http://blog.cosmoskey.com/powershell/desired-state-configuration-in-pull-mode-over-smb/
Function Get-ComputerGuid {
param(
[Parameter(Mandatory=$true)]
[string]$ComputerName
)
process {
([guid]([adsisearcher]"(samaccountname=$ComputerName`$)").FindOne().Properties["objectguid"][0]).Guid
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.