Tag: Test-Connection

PS: Remotely Enable Bit-locker

PS: Remotely Enable Bit-locker

I found this script of which you may find useful from the following website to enable Bit-locker remotley utilizing powershell

https://gallery.technet.microsoft.com/scriptcenter/Remotely-enable-Bitlocker-348aeba6

$List = Get-Content ".\list.txt"   
Start-Transcript -Path ".\bitlockertranscript.txt" -Force  
foreach ($Computer in $List) {   
   
        if (test-Connection -ComputerName $Computer -Count 1 -Quiet ) {    
           
            Get-ADComputer -Identity $Computer -Property * | Select Name,OperatingSystem 
            Get-WmiObject -class Win32_Tpm -namespace root\CIMV2\Security\MicrosoftTpm  -computername $Computer | fl IsActivated_InitialValue, IsEnabled_InitialValue, IsOwned_InitialValue   
            $BitLocker = Get-WmiObject -ComputerName $Computer -Namespace Root\cimv2\Security\MicrosoftVolumeEncryption -Class Win32_EncryptableVolume 
            $id = $BitLocker.GetKeyProtectors(3).volumekeyprotectorid | Select -First 1 
            manage-bde.exe -cn $Computer -protectors -adbackup c: -id $id 
            manage-bde.exe -on C: -cn $Computer 
           
                    } else   
                       
                    {"No Connection to $Computer"   
               
                    }       
           
} 
Stop-Transcript 
PS: Ping the PowerShell way!

PS: Ping the PowerShell way!

Old Ping Command V New Ping Command:

# Traditional CMD
Ping 127.0.0.1
# New Powershell Replacement
Test-Connection -computername 127.0.0.1

 

TechNet Full Syntax

Parameter Set: Default
Test-Connection [-ComputerName] <String[]> [-AsJob] [-BufferSize <Int32> ] [-Count <Int32> ] [-DcomAuthentication <System.Management.AuthenticationLevel> {Default | None | Connect | Call | Packet | PacketIntegrity | PacketPrivacy | Unchanged} ] [-Delay <Int32> ] [-Impersonation <ImpersonationLevel> {Default | Anonymous | Identify | Impersonate | Delegate} ] [-Protocol <String> {DCOM | WSMan} ] [-ThrottleLimit <Int32> ] [-TimeToLive <Int32> ] [-WsmanAuthentication <String> {Default | Basic | Negotiate | CredSSP | Digest | Kerberos} ] [ <CommonParameters>]

Parameter Set: Quiet
Test-Connection [-ComputerName] <String[]> [-BufferSize <Int32> ] [-Count <Int32> ] [-DcomAuthentication <System.Management.AuthenticationLevel> {Default | None | Connect | Call | Packet | PacketIntegrity | PacketPrivacy | Unchanged} ] [-Delay <Int32> ] [-Impersonation <ImpersonationLevel> {Default | Anonymous | Identify | Impersonate | Delegate} ] [-Protocol <String> {DCOM | WSMan} ] [-Quiet] [-TimeToLive <Int32> ] [-WsmanAuthentication <String> {Default | Basic | Negotiate | CredSSP | Digest | Kerberos} ] [ <CommonParameters>]

Parameter Set: Source
Test-Connection [-ComputerName] <String[]> [-Source] <String[]> [-AsJob] [-BufferSize <Int32> ] [-Count <Int32> ] [-Credential <PSCredential> ] [-DcomAuthentication <System.Management.AuthenticationLevel> {Default | None | Connect | Call | Packet | PacketIntegrity | PacketPrivacy | Unchanged} ] [-Delay <Int32> ] [-Impersonation <ImpersonationLevel> {Default | Anonymous | Identify | Impersonate | Delegate} ] [-Protocol <String> {DCOM | WSMan} ] [-ThrottleLimit <Int32> ] [-TimeToLive <Int32> ] [-WsmanAuthentication <String> {Default | Basic | Negotiate | CredSSP | Digest | Kerberos} ] [ <CommonParameters>]