Koerkel

Need to connect as SuperUser

Discussion created by Koerkel on Nov 7, 2019
Latest reply on Nov 8, 2019 by Koerkel

I'm writing a little VB.net program that will search through my AF database for a specific attribute that I need to change.  The problem is my regular ID only has read access to the AF so I need to connect using my superuser account.  I've tried a couple different methods but can't seem to get a log in prompt to pop up so I can switch to my super user account.  Any suggestions how to get a log in prompt to pop up to switch my ID? 

 

Here is a code sample I am using to play with:

 

Dim myPISystems As New PISystems()
Dim myPISystem As PISystem = myPISystems("AFSystem")
Dim user As String = "SuperUserAccount"
Dim password As String = String.Empty
myPISystem.Disconnect()
Dim credential As NetworkCredential = New NetworkCredential(user, password)
'myPISystem.Connect(False, Nothing, AFConnectionPreference.RequirePrimary)
'myPISystem.Connect(True, Nothing, AFConnectionPreference.RequirePrimary)

myPISystem.Connect(credential, AFConnectionPreference.Any)

Dim myAF As AFDatabase = myPISystem.Databases("AFDatabase")

Outcomes