Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1.  
  2. #CSV FILE
  3. #ComputerName;Database;Shop
  4. #1003;BFP2HQ;s1003-t2
  5. #1003;BFP2HQ;s1003-t2
  6.  
  7.  
  8. #Declare CSV File
  9. $FileData = Import-Csv .\INVENTARY.csv -Delimiter ';'
  10. Write-host $FileData
  11.  
  12. #CSV File Browsing
  13. ForEach ($Data in $FileData)
  14. {
  15. $ComputerName = $($Data.ComputerName)
  16. $Database = $($Data.Database)
  17. $Shop = $($Data.Shop)
  18. $Collection = $($Data.Collection)
  19.  
  20. Write-host $ComputerName $Database $Shop $Collection
  21.  
  22.  
  23. }
  24.  
  25.  
  26. #Import Module RemoteDesktop
  27. Import-Module RemoteDesktop
  28.  
  29. #Create new RDP by BWA-AV-OSH-01 10.6.53.1 (Betting Till: RDS Session Host | Broker)
  30. New-RDRemoteApp -Alias "$Shop" -CollectionName "$Collection" -DisplayName "$Shop" -FilePath "\\donebros\Remote Apps\Remote Apps\BscmsTill.cmd $Database $ComputerName" -IconPath "\\donebros\Tills\SCMSTill\Shop Till.Net.exe"
  31.  
  32.  
  33.  
  34. #Start "Taskkill Shop Till" "C:\Windows\System32\taskkill.exe" /f /fi "imagename eq Shop Till.Net.exe" /fi "username eq %userdomain%\%username%" | "C:\Windows\System32\find.exe" /i "Shop Till.Net.exe" > nul || Start "Demo Till .Net 1" /d "D:\Tills\SCMSTill\" "D:\Tills\SCMSTill\Shop Till.Net.exe" /db=%1 /computername=%2
  35. #Exit.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement