control

User Account Control (UAC) and Admin Approval Mode

User Account Control: Turn on Admin Approval Mode

How to control and configure services on a Remote server

Remote Control of a Windows Server services is accomplished using a domain computer and vaild domain credentials with appropriate permissions:

 

use the following command(s):

sc \\<Computer Name> query

sc \\<Computer Name> config "[SERVICE NAME]" start= disabled

 

PowerShell : Using Try / Finally block to catch a Ctrl-C and cleanup

Powershell script termination examples

function Close-Script {
    #If stream1 is created
    if($stream1) { 
        $stream1.Close()
    }

    #Terminate script
    exit
}

$stream1 = New-Object System.IO.StreamWriter filename.txt


If(a test that detects your error) {
    Close-Script
}


Subscribe to RSS - control