Roman Alex

Extreme Faster Verified Trusted Prime Seller
Staff member
Verified Trusted Seller
Apr 1, 2019
3,120
1,019
113
Russia
www.russiancarders.se
#1
minute:
Start-Sleep 60; Restart-Computer –Force –ComputerName TARGETMACHINE


22. Add a printer:
(New-Object -ComObject WScript.Network).AddWindowsPrinterConnection("\\printerserver\hplaser3")


23. Remove a printer:
(New-Object -ComObject WScript.Network).RemovePrinterConnection("\\printerserver\hplaser3 ")


24. Enter into a remote PowerShell session -- you must have remote management enabled:
enter-pssession TARGETMACHINE


25. Use the PowerShell invoke command to run a script on a remote servers:
invoke-command -computername machine1, machine2 -filepath c:\Script\script.ps1


Bonus command

To dismiss a process you can use the process ID or the process name. The -processnameswitch allows the use of wildcards. Here's how to stop the calculator:
Stop-Process -processname calc*
 

Log in

Online statistics

Members online
1
Guests online
60
Total visitors
61