Archive | Powershell RSS feed for this section

Delete the Contents of a Folder with Powershell

The following commands will allow you to clear the contents of a folder, in this case the C:\Users folder, and exclude those folders you do not wish to delete: $dirs – Get-ChildItem C:\Users -Exclude Public,Default,Administrator,”All Users”,”Default User” $dirs | % {rd $_ -Recurse -Force} This could be usedto clean up Remote Desktop Severs or Cirtix […]

Continue reading

Replicating Printer Drivers in XenApp 6

The following command will replicate the drivers whos name start with “hp uni” to the servers specified at the end of the command. The -confoirm at the end lets you confirm that each driver will be replicated or not: Manual Replication: Start-XAPrinterDriverReplication -drivername “hp uni*” -sourceservername desk05 -servername desk01,desk07 -confirm Confirm Are you sure you […]

Continue reading