Siete in un ambiente lavorativo dove il vostro computer è alla portata di tutti e temete che qualcuno si colleghi, o almeno provi a farlo tentando di indovinare la vostra password, appena vi allontanate. Vediamo quindi come visualizzare a video l’ultimo tentativo riuscito e fallito, inoltre possiamo estrarre una lista di tutti i login corretti effettuati e la loro durata nei vari giorni in cui sono stati fatti. [continua..]
Ciao @crazy.cat
ho rinominato il tuo .ps1 in utenti.ps1 (per praticità nel lanciarlo) e l'ho copiato in una directory mia del secondo disco ma anche in c:\users\MioPc ma (aprendo PowerShell come amministratore) e lanciandolo sia dal secondo disco che da c: il risultato è questo:
utenti.ps1: The term 'utenti.ps1' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Suggestion [3,General]: The command utenti.ps1 was not found, but does exist in the current location. PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\utenti.ps1". See "get-help about_Command_Precedence" for more details.
Hai qualche suggerimento ?
Grazie
Ultima modifica di VRR il lun set 11, 2023 9:21 am, modificato 1 volta in totale.
c:\Users\MioPc\utenti.ps1: The term 'c:\Users\MioPc\utenti.ps1' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Ti ho già mandato la copia dell'errore....
La prima volta l'ho lanciato dal secondo disco (sia stando in c: che in F:) usando cartella di prova (F:\xxx-TURBOLAB\utenti.ps1 ).... poi ps1 l'ho copiato in c:\users\MioPc e l'ho rilanciato sempre col path c:\users\MioPc\utenti.ps1
Questo è con ps1 in F e la sintassi è giusta:
f:\xxx-TURBOLAB\utenti.ps1: File F:\xxx-TURBOLAB\utenti.ps1 cannot be loaded. The file F:\xxx-TURBOLAB\utenti.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https://go.microsoft.com/fwlink/?LinkID=135170.
OK !!! Ora funziona
L'ho dovuto settare unrestricted, era AllSigned
Ma direttamente con Set-ExecutionPolicy unrestricted era venuto fuori questo errore:
Set-ExecutionPolicy: Access to the path 'C:\Program Files\WindowsApps\Microsoft.PowerShell_7.3.6.0_x64__8wekyb3d8bbwe\powershell.config.json' is denied.
To change the execution policy for the default (LocalMachine) scope, start PowerShell with the "Run as administrator" option. To change the execution policy for the current user, run "Set-ExecutionPolicy -Scope CurrentUser".
Poi ho digitato Set-ExecutionPolicy -Scope CurrentUser e successivamente unrestricted
E' complicato PowerShell sono abituato con Promt dei comandi...
Tutte queste restrizioni PowerShell immagino siano state applicate per evitare rischi di infezioni virali...
-----------------
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\Users\MioPc\utenti.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): R
----------------
Funziona anche lanciandolo con path in F:
Grazie per l'aiuto !!!!
Inserendo un messaggio, dichiari di aver letto e accettato il regolamento di partecipazione.
Nello specifico, sei consapevole che ti stai assumendo personalmente la totale responsabilità delle tue affermazioni, anche in sede civile e/o penale,
manlevando i gestori di questo sito da ogni coinvolgimento e/o pretesa di rivalsa.
Dichiari inoltre di essere consapevole che il messaggio sarà visibile pubblicamente, accetti di diffonderlo con licenza
CC BY-NC-SA 3.0 (con attribuzione a "TurboLab.it") e rinunci ad ogni forma di compensazione (economica o altro).
Rinunci inoltre esplicitamente a qualsiasi pretesa di cancellazione del messaggio.