You can go at this several ways and it can get somewhat complicated depending on the route that you take. Let's first look at spawning an EXE to perform a certain action with different credentials. Dim startInfo As New System.Diagnostics.ProcessStartInfo("C:\MyApp.exe")
Dim password As New System.Security.SecureString()
Dim process As System.Diagnostics.Process
'-- Build the secure password string
For Each c As Char In "MyPassword"
password.AppendChar(c)
Next
'-- Set the security login credentials
startInfo.UserName = "MyWindowsUser"
startInfo.Domain = "MYDOMAIN"
startInfo.Password = password
'-- Spawn the process
process = System.Diagnostics.Process.Start(startInfo)
'-- If you want to wait for the process to exit you can wait like this
process.WaitForExit()
Now if you want to create isolation levels within your assembly, it gets a lot more complicated. You will have to apply security attributes and configure each client machine that will execute the code. I am obviously not getting too deep here as this can become a really big tutorial in and of itself, but if you have this need, then a web search would probably be your best best as I ams ure that there are probably already some articles out on CodeProject or something along those lines showing how to do this.