Last active
August 27, 2020 07:50
-
-
Save falkheiland/90c786738735011d541e3291a65766cd to your computer and use it in GitHub Desktop.
Set the current IP address of a device as Last IP in the UMS (feature to do so in the UMS itself was removed)
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
# https://github.com/IGEL-Community/PSIGEL | |
# Install-Module -Name PSIGEL | |
$PSDefaultParameterValues = @{ | |
'*-UMS*:Computername' = 'igelrmserver' | |
'New-UMSAPICookie:Credential' = (Get-Credential) | |
} | |
$PSDefaultParameterValues += @{ | |
'*-UMS*:WebSession' = New-UMSAPICookie -ErrorAction Stop | |
} | |
$Name = Read-Host -Prompt "Enter the name of the Device" | |
$CurrentIP = Read-Host -Prompt "Enter the current IP address of the Device" | |
(Get-UMSDevice).where{ $_.Name -eq $Name }[0] | | |
Update-UMSDevice -LastIP $CurrentIP | |
<# | |
[PS> c:\SetDeviceLastIp.ps1 | |
PowerShell credential request | |
Enter your credentials. | |
User: igelums | |
Password for user igelums: ******* | |
Enter the name of the Device: L-DIS-012 | |
Enter the current IP address of the Device: 192.168.1.1 | |
Message Id | |
------- -- | |
Update successful. 522 | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment