Advertisement
Guest User

Untitled

a guest
Feb 1st, 2016
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2. This script retrieves the room number from a PC assuming format: ABC101SYS002,
  3. then calls the Insight installer passing along the room as the Channel name.
  4. It adjusts for campuses ABC and XYZ, prepending a 2/3 (ABC116 = channel 2116).
  5. It also removes the leading zero in a room (ABC019 = channel 19).
  6. #>
  7.  
  8. $PC = $env:computername
  9. $Bldg = $PC.Substring(0,3)                                      #parse from 1st character for 3 characters
  10. $Room = $PC.Substring(3,3)                                      #parse from 4th character for 3 characters
  11.  
  12. If ($Bldg -eq "abc") {$Bldg = "2"}                              #Evaluate Building for campuses, assign code value
  13. ElseIf ($Bldg -eq "xyz") {$Bldg = "3"}  
  14. Else {$Bldg = ""}
  15.  
  16. if ($Room.Substring(0,1) -eq "0") {$Room = $Room.Substring(1,2)} #remove leading zero
  17.  
  18. $Chan = $Bldg += $Room                                          #creates channel number, prepending Building code
  19.  
  20. 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