Quantcast
Channel: ConfigMgr 2012 - Powershell Right Click Tools
Viewing all articles
Browse latest Browse all 140

New Post: Access clients by shortname

$
0
0
I think we have the same issue. Our clients have (due to a legacy domain) multiple domain suffixes. SCCM will store these in the "Resource Names" device property. When a device has a different suffix registered in SCCM than the primary DNS name it will fail to connect. By changing the code to do a DNS query it will allways use the right suffix when connecting to a device.

This is our solution:

Folder: C:\Program Files (x86)\Now Micro\Right Click Tools
Files:
  • Device - Change Cache Size.ps1
  • Device - Client Information.ps1
  • Device - Group Policy Update.ps1
  • Device - Ping.ps1
  • Device - Rerun Advertisement.ps1
  • Device - Running Processes.ps1
  • Device - Schedule Shutdown.ps1
  • Device - Shutdown Restart.ps1
  • Device - System Information.ps1
  • Device - Tools.ps1
Replace:
 #Region Get Computer Name
if ($ResourceID.Contains(".")) {$CompName = $ResourceID}
else {
    $strQuery = "Select ResourceID,ResourceNames from SMS_R_System where ResourceID='$ResourceID'"
    Get-WmiObject -Query $strQuery -Namespace $Namespace -ComputerName $Server | ForEach-Object {$CompName = $_.ResourceNames[0]}
}
#endregion 
By:
#Region Get Computer Name
if ($ResourceID.Contains(".")) {$CompName = $ResourceID}
else {
    $strQuery = "Select ResourceID,Name from SMS_R_System where ResourceID='$ResourceID'"
    Get-WmiObject -Query $strQuery -Namespace $Namespace -ComputerName $Server | ForEach-Object {$CompName = [System.Net.Dns]::GetHostByName($_.Name).hostname}
}
#endregion

Viewing all articles
Browse latest Browse all 140

Trending Articles