Function Get-DeleteNetworkPrinters
{
$NetworkPrinters = Get-WmiObject -Class Win32_Printer | Where-Object{ $_.Network }
If ($NetworkPrinters -ne $null)
{
Try
{
Foreach ($NetworkPrinter in $NetworkPrinters)
{
$NetworkPrinter.Delete()
Write-Host "Successfully deleted the network printer:" + $NetworkPrinter.Name -ForegroundColor Green
}
}
Catch
{
Write-Host $_
}
}
Else
{
Write-Warning "Cannot find network printer in the currently environment."
}
}
Взглянул нa Redmine, думаю, попробую его.