Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to verify local user&password on a remote machine with PowerShell

$
0
0

Hi everyone, Please help me, I am writing a script that can rename,join,rejoin,remove remote computer in domain.

I need to verify local user and his password on a remote machine. Here is my function:

Function GetLocalUser

{

#ask to input local admin username

#set it as admin if you press enter

if (($FLuser = Read-Host "Input local username(press enter for admin)") -eq $null) { $FLuser = "admin" }

#ask to input password for local user, it can not be blank

do { $FLPwd = Read-Host "Input"$FLuser"'s password" } while ($FLPwd -eq $null) Write-Host "Verifying..." -BackgroundColor DarkGreen -ForegroundColor Yellow } And now I would like to verify $FLuser and $FLPwd on a remote machine.

}

I am novice in power shell and have got stuck, so please help me.

Thank you.

Best regards, ZamElek



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>