NET USE
consente di aggiungere una lettera di unità locale per il sistema remoto, che poi poi consente di utilizzare la lettera di unità nel vostro PSSession, o anche senza una sessione PSSession. Questo è utile se non hai Powershell v5.0, e anche se lo fai,
È possibile utilizzare il nome del computer remoto o il suo indirizzo IP come parte del percorso UNC remoto ed è possibile specificare le credenziali di nome utente e password sulla stessa linea:
NET USE Z: \\192.168.1.50\ShareName /USER:192.168.1.50\UserName UserPassword
Un altro esempio:
NET USE Z: \\RemoteSystem\ShareName /USER:RemoteSystem\UserName UserPassword
O
NET USE Z: \\RemoteSystem\ShareName /USER:Domain\UserName UserPassword
Se non si forniscono il cr utente edentials sulla stessa linea, verrà richiesto per loro:
>NET USE Z: \\192.168.1.50\ShareName
Enter the user name for '192.168.1.50': 192.168.1.50\UserName
Enter the password for 192.168.1.50: *****
The command completed successfully.
è possibile rimuovere la lettera di unità quando hai finito con il seguente:
NET USE Z: /delete
È possibile ottenere la sintassi completa con NET USO /?
>net use /?
The syntax of this command is:
NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[[email protected] domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]
NET USE {devicename | *} [password | *] /HOME
NET USE [/PERSISTENT:{YES | NO}]
NET
è un comando standard .exe esterno nella cartella di sistema e lavora a PowerShell bene.
Perché non usi la condivisione in rete per copiare i tuoi file? – JPBlanc
Bello, ma le autorità superiori non lo approvano :) –
Se è possibile abilitare il computer remoto come "trusted per delega" in AD, è possibile eseguire il secondo hop senza CredSSP. –