-
-
Save FlorianAlikoff/13374c15f16c0974d4ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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