A new Flexera Community experience is coming on November 25th, click here for more information.
for /f "tokens=1-2" %%i in ('nslookup %computername% 192.168.xxx.xxx ^| findstr /N Address ^| findstr /V 192.168.xxx.xxx') do set IP=%%j
reg add "HKLM\Software\InterSect Alliance\AuditService\Config" /v ClientName /t REG_SZ /d %IP% /f
pause
Jan 20, 2009 01:16 PM
Jan 21, 2009 03:23 PM
Tony_Toni_Tone wrote:
Can't you use dns and put the fully qualified name in the package?
Jan 22, 2009 03:07 PM
Jan 22, 2009 04:37 PM
Tony_Toni_Tone wrote:
I thought you were getting the ip address of a server on the network and then adding that servers IP address to the workstations registry?
Are there multiple servers?
Jan 22, 2009 04:45 PM
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT IPAddress FROM Win32_NetworkAdapterConfiguration",,48)
For Each objItem In colItems
If Not IsNull(objItem.IPAddress) Then
IP = objItem.IPAddress(0)
Exit For
End If
Next
Session.Property("IP_ADDY") = IP
Jan 22, 2009 07:12 PM
Tony_Toni_Tone wrote:
So you just need to write the ip address into the registry of the server the package is being installed on.. the %computername% in nslookup threw me..
if I have understood correctly you could add this script stored in a custom action
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT IPAddress FROM Win32_NetworkAdapterConfiguration",,48)
For Each objItem In colItems
If Not IsNull(objItem.IPAddress) Then
IP = objItem.IPAddress(0)
Exit For
End If
Next
Session.Property("IP_ADDY") = IP
Create a property IP_ADDY=NotSet
Set registy value in package to [IP_ADDY]
NotSet will be replaced with IP Address..
Jan 23, 2009 11:26 AM
Jan 23, 2009 12:42 PM