Posted On March 31, 2019

Query Print Spooler of SERVER1

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Query Print Spooler of SERVER1
function getStatus($server, $service){
   Get-WmiObject Win32_Service -Filter "Name Like 'spooler'" -computer SERVER1 -credential $cred | select Name, State, StartMode, StartName
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Basic CSS: Override All Other Styles by using Important

<style>body {background-color: black;font-family: monospace;color: green;}#orange-text {color: orange;}.pink-text {color: pink;}.blue-text {color: blue;}</style><h1 id="orange-text" class="pink-text blue-text" style="color:…

PowerShell: Get OU of a User & Get All Users In an OU

function getUserOu($username){ if(!(get-module activedirectory -ea SilentlyContinue)){ $osType=switch ((Get-CimInstance -ClassName Win32_OperatingSystem).ProductType){ 1 {'client'} 2 {'domaincontroller'} 3…

PowerShell: Remove or Disable Windows Defender

$username='domain\serviceAccount' $password='PasswordHere' $encryptedPassword=ConvertTo-SecureString $password -AsPlainText -Force $credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $userName,$encryptedPassword; $computerNames=@( 'SERVER01',…