Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFSecurity.RemoveUser Method (PISystem, String)

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFSecurity.RemoveUser Method (PISystem, String)
Remove all security rights for a user account from all objects in the PISystem.

Namespace:  OSIsoft.AF
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static void RemoveUser(
	PISystem system,
	string accountName
)
Public Shared Sub RemoveUser ( 
	system As PISystem,
	accountName As String
)

Dim system As PISystem
Dim accountName As String

AFSecurity.RemoveUser(system, accountName)
public:
static void RemoveUser(
	PISystem^ system, 
	String^ accountName
)
static member RemoveUser : 
        system : PISystem * 
        accountName : string -> unit 

Parameters

system
Type: OSIsoft.AFPISystem
The PISystem containing the objects to be modified.
accountName
Type: SystemString
The account name of the user to be removed from the objects.

Remarks

This method will remove all the access and deny security rights for the user account from every object in the PI AF Server associated with the PISystem.
Important note Important
Since the AddUser Overload method can modify existing security settings, this method cannot restore the objects to their original security settings.
Note Notes to Callers
For PI AF Server 2.7 or later you can call the RemoveUser Overload method that accepts an AFSecurityIdentity to set the security access control with the new security identities which is supported by newer servers. You can use the PISystem.Supports method to check if the server supports SecurityIdentity.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in