What am I trying to do?
Hi! I am writing a script that can accept 2 parameters, ComputerName and CheckWhatFile. The script will then access the computer
Something like this might work:
$provider = "WinNT://$ComputerName/LanmanServer" $cred = Get-Credential $netfile = New-Object DirectoryServices.DirectoryEntry( $provider, $cred.UserName, $cred.GetNetworkCredential().Password ) $netfile.Invoke("Resources") | % { ... }