Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$context = [System.DirectoryServices.AccountManagement.ContextType]::Domain
$principalc = New-Object System.DirectoryServices.AccountManagement.PrincipalContext($context, 'local.intra', 'testuser','pass')
$principalc.ConnectedServer
$principalc.ValidateCredentials('testuser','pass')
No comments:
Post a Comment