Skip to content

Instantly share code, notes, and snippets.

@Kaidja
Last active February 10, 2018 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kaidja/64e6a5da44fc71d8bafc990daad9d9a5 to your computer and use it in GitHub Desktop.
Save Kaidja/64e6a5da44fc71d8bafc990daad9d9a5 to your computer and use it in GitHub Desktop.
#Check if device exists in Configuration Manager
Import-Module $env:SMS_ADMIN_UI_PATH.Replace("\bin\i386","\bin\configurationmanager.psd1")
$CMSite = Get-PSProvider -PSProvider CMSITE
Set-Location -Path "$($CMSite.Drives.Name):\"
#Query against Configuration Manager
$ADComputerInfo = Get-ADComputer -Identity PC1
Get-CMDevice -Name $ADComputerInfo.Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment