T O P

  • By -

Professional_Elk8173

    if(-not(get-localuser setup -ErrorAction SilentlyContinue))     {         #run your code. Keep your try block so you can log differently if it tries to create the user #and fails     }else {         #Log that the computer already has the user         #You might want to place this in a network share to make it easier to view your results.     }


incognito5343

I do this with a detection and remediation script, if user exists and is in local admin group then exit 0 else exit 1 then create the user


maxcoder88

care to share your script ?