Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- This script retrieves the room number from a PC assuming format: ABC101SYS002,
- then calls the Insight installer passing along the room as the Channel name.
- It adjusts for campuses ABC and XYZ, prepending a 2/3 (ABC116 = channel 2116).
- It also removes the leading zero in a room (ABC019 = channel 19).
- #>
- $PC = $env:computername
- $Bldg = $PC.Substring(0,3) #parse from 1st character for 3 characters
- $Room = $PC.Substring(3,3) #parse from 4th character for 3 characters
- If ($Bldg -eq "abc") {$Bldg = "2"} #Evaluate Building for campuses, assign code value
- ElseIf ($Bldg -eq "xyz") {$Bldg = "3"}
- Else {$Bldg = ""}
- if ($Room.Substring(0,1) -eq "0") {$Room = $Room.Substring(1,2)} #remove leading zero
- $Chan = $Bldg += $Room #creates channel number, prepending Building code
- msiexec.exe /i "\\locationoffile\Student.msi" /norestart /qn /l c:\users\admin\desktop\insightLog.txt ADVANCED_OPTIONS=1 CHANNEL=$Chan STEALTH_MODE=1 NO_KEYBOARD_MONITORING_MODE=1 AD_SECURE_MODE=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement