Allow only specified users

I have designed a script, which should allow only specific users(VM has multiple user logins but should allow only 3 to 4 users able to run the script)
How could we achieve this?

@SN2

You can use system.Environment.UserName to get the UserName
You can use system.Environment.UserDomainName to get the domain Name

Using above values you can place your logic

Mark as solution if this helps

Thanks

1 Like