Test-ComputerSecureChannel - PowerShell


 

Tests and repairs the secure channel between the local computer and its domain. (Test-ComputerSecureChannel)

   

# NAME
Test-ComputerSecureChannel

# SYNOPSIS
Tests and repairs the secure channel between the local computer and its domain.

# SYNTAX
Test-ComputerSecureChannel [-Repair] [-Server <string>] [-Confirm] [-WhatIf] [<CommonParameters>]

# DESCRIPTION
The Test-ComputerSecureChannel cmdlet verifies that the secure channel between the local computer and its domain is working correctly by checking the status of its trust relationships. If a connection fails, you can use the Repair parameter to try to restore it.

Test-ComputerSecureChannel returns "True" if the secure channel is working correctly and "False" if it is not. This result lets you use the cmdlet in conditional statements in functions and scripts. To get more detailed test results, use the Verbose parameter.

This cmdlet works much like NetDom.exe. Both NetDom and Test-ComputerSecureChannel use the NetLogon service to perform the actions.

# PARAMETERS
-Repair [<SwitchParameter>]
Removes and then rebuilds the secure channel established by the NetLogon service. Use this parameter to try to restore a connection that has failed the test (returned "False".)

To use this parameter, the current user must be a member of the Administrators group on the local computer.

Required? false
Position? named
Default value None
Accept pipeline input? false
Accept wildcard characters? false

-Server <string>
Uses the specified domain controller to run the command. If this parameter is omitted, Test-ComputerSecureChannel selects a default domain controller for the operation.

Required? false
Position? named
Default value None
Accept pipeline input? false
Accept wildcard characters? false

-Confirm [<SwitchParameter>]
Prompts you for confirmation before executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf [<SwitchParameter>]
Describes what would happen if you executed the command without actually executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

# INPUTS
None
You cannot pipe input to this cmdlet.

# OUTPUTS
System.Boolean
The cmdlet returns "True" when the connection is working correctly and "False" when it is not.

# NOTES

To run a Test-ComputerSecureChannel command on Windows Vista and later versions of Windows, open Windows PowerShell with the "Run as administrator" option.

Test-ComputerSecureChannel is implemented by using the I_NetLogonControl2 function, which controls various aspects of the Netlogon service.

# EXAMPLE 1

C:\PS>test-computersecurechannel

True

# Description
-----------
This command tests the secure channel between the local computer and the domain to which it is joined.

# EXAMPLE 2

C:\PS>test-computersecurechannel -server DCName.fabrikam.com

True

# Description
-----------
This command specifies a preferred domain controller for the test.

# EXAMPLE 3

C:\PS>Test-ComputerSecureChannel -repair

True

# Description
-----------
This command resets the secure channel between the local computer and its domain.

# EXAMPLE 4

C:\PS>test-computerSecureChannel -verbose

VERBOSE: Performing operation "Test-ComputerSecureChannel" on Target "SERVER01".
True
VERBOSE: "The secure channel between 'SERVER01' and 'net.fabrikam.com' is alive and working correctly."

# Description
-----------
This command uses the Verbose common parameter to request detailed messages about the operation. For more information about the Verbose parameter, see about_CommonParameters.

# EXAMPLE 5

C:\PS>set-alias tcsc test-computersecurechannel

if (!(tcsc))
{write-host "Connection failed. Reconnect and retry."}
else { &(.\get-servers.ps1) }

# Description
-----------
This example shows how to use Test-ComputerSecureChannel to test a connection before running a script that requires the connection.

The first command uses the Set-Alias cmdlet to create an alias for the cmdlet name. This saves space and prevents typing errors.

The If statement checks the value that Test-ComputerSecureChannel returns before running a script.

RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkID=137749
Checkpoint-Computer
Restart-Computer
Stop-Computer
Reset-ComputerMachinePassword

C:\Windows>powershell get-help Reset-ComputerMachinePassword -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2014 Microsoft Corporation.

OS: Windows 10, 8.1, 8, 7, Vista / Windows Server 2016, 2012, 2008
»»»» ColorConsole








Windows-10





Windows-10

... facebook.de
... Windows-10 FAQ
... Windows-10 Info


Become a Sponsor
... Your button here?





PowerShell: Tests and repairs the secure channel between the local computer and its domain.

HTTP: ... PS_Windows/en/Test-ComputerSecureChannel.htm
0.218
17253

System admin Windows 10, can I activate the full admin account?

 /

Windows 7 direct download links all versions!

 /

Is it possible to adjust the window animations under Windows 10?

 /

Wie ändere ich die Hintergrundfarbe des aktiven Explorer-Fensters?

 /

Is there the Quad-Directory File Manager for Linux or Mac OS X?

 /

MEMORY.DMP Datei?

 /

Change Mouse Pointer and Cursor size on Windows-10, (smaller, larger)?

 /

Verknüpfung zur Verwaltung drahtloser Netzwerke auf Windows-10?

 /

The stop-clock does not display hours?

 /

Temporäre Scans kann ich nicht löschen, warum?

 /

Wie kann ich die Windows-7 Aktivierungsaufforderung verhindern, oder aushebeln?

 /

Protect your hardware on the computer!

 /