Access clients by shortname

Feb 19, 2014 at 6:53 AM
I found out that the tool access the clients using a SCCM 2012 proprty which is the FQDN.
In my environment that is not working and my question is if it is easy to change some scripts so that the clients will be access by shortname ?
Jul 3, 2014 at 3:16 PM
Edited Aug 4, 2014 at 7:49 AM
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: (no need to restart anything!)

Folder: C:\Program Files (x86)\Now Micro\Right Click Tools
Files:
  • Device - Device - Client Actions.ps1 (edit 04-08-2014; this one too)
  • 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