Desktop activities
Depending on the goals of your desktop activity, you might allow only users with accounts in the trusted DPM NT user group (typically the group specified during installation) to log in, or you might ask users for their user name and password. The following VB .NET code snippet shows how this can be done.
' Only members of the DPMAdminTrustees group will be able to log in this way.
' If this log-in succeeds, the user will have access to all projects,
' activities, and features.
If Not(Agent.LoginAsTrustedWindowsAccount()) Then
' Log-in failed. Try logging in as a non-trusted NT user.
If Not (Agent.LoginUsingWindowsAccount()) Then
' Log-in failed using the Windows account.
' Display a dialog prompting for a user name and password
' and try logging in using this DPM user account.
Agent.Login(strUserName,strPassword,Nothing)
End If
End If
' Check that the user was logged in successfully
If Not(Agent.IsAuthenticated) Then
' The user cannot be logged in using any of these methods.
' Log-in fails.
End If
...
If (Agent.IsAuthenticated) Then
Agent.Logout
End If
See also