Returns a list of local user groups in the specified domain/library.
Visual Basic (declaration) |
---|
Public Function GetLocalGroups( _ |
C# (declaration) |
---|
public XmlNode GetLocalGroups( |
<response success="true" error="">
<usergroups>
<usergroup groupname="abc"/>
<usergroups/>
</response>
Visual Basic Example |
---|
Public Sub GetLocalGroups_Sample() Const IRAuthenticationTicket As String = "sid-xxxxxxxxxxxxx" Const IR_DomainName As String = "Public" Dim IR_Obj As InfoRouter.srv Dim xmlResponse As System.Xml.XmlElement Try IR_Obj = New InfoRouter.srv xmlResponse = IR_Obj.GetLocalGroups(IRAuthenticationTicket, _ IR_DomainName) If xmlResponse.GetAttribute("success") = "true" Then Console.WriteLine("-- " & IR_DomainName & " [Local groups] --") Dim xmlGroups As System.Xml.XmlElement = xmlResponse.FirstChild Dim xmlgroup As System.Xml.XmlElement For Each xmlgroup In xmlGroups.ChildNodes Console.WriteLine(xmlgroup.GetAttribute("GroupName")) Next Console.WriteLine("-----------") xmlGroups = Nothing Else Console.WriteLine("The local groups cannot be listed.") Console.WriteLine("server response:" & xmlResponse.GetAttribute("error")) End If xmlResponse = Nothing Catch ex As Exception Console.WriteLine("error:" & ex.Message) Finally IR_Obj = Nothing End Try End Sub |