I'm trying to create login script that writes computer name user is logged on in some (no matter which) aduser property. Idea was to use set-aduser cmdlet with admins creds stored in a file but there are numerous security risks coming from there. Is there a way to delegate adusers rights to powershell (i already did that for their own properties on AD). Or (maybe even better) does anyone have any better idea? This is more something of experiment and I really want to use powershell (I know there's a vbscript that does exactly the same thing i would like to do).
Thank you and best regards!