Package com.sun.jna.platform.win32

## Class Netapi32Util

- java.lang.Object
- - com.sun.jna.platform.win32.Netapi32Util

    public abstract class Netapi32Util
    extends java.lang.Object

Netapi32 Utility API.

Author:
  dblock[at]dblock.org

### Nested Class Summary

Nested Classes
`static class` `Netapi32Util.DomainController` A domain controller.
`static class` `Netapi32Util.DomainTrust` A domain trust relationship.
`static class` `Netapi32Util.Group` A group.
`static class` `Netapi32Util.LocalGroup` A local group.
`static class` `Netapi32Util.User` A user.
`static class` `Netapi32Util.UserInfo`

### Constructor Summary

Constructors
`Netapi32Util()`

### Method Summary

All Methods Static Methods Concrete Methods
`static Netapi32Util.Group[]` `getCurrentUserLocalGroups()` Get local groups of the current user.
`static Netapi32Util.DomainController` `getDC()` Return the domain controller for a current computer.
`static java.lang.String` `getDCName()` Returns the name of the primary domain controller (PDC) on the current computer.
`static java.lang.String` `getDCName​(java.lang.String serverName, java.lang.String domainName)` Returns the name of the primary domain controller (PDC).
`static java.lang.String` `getDomainName​(java.lang.String computerName)` Get information about a computer.
`static Netapi32Util.DomainTrust[]` `getDomainTrusts()` Retrieve all domain trusts.
`static Netapi32Util.DomainTrust[]` `getDomainTrusts​(java.lang.String serverName)` Retrieve all domain trusts for a given server.
`static Netapi32Util.Group[]` `getGlobalGroups()` Get the names of global groups on a computer.
`static Netapi32Util.Group[]` `getGlobalGroups​(java.lang.String serverName)` Get the names of global groups on a computer.
`static int` `getJoinStatus()` Return the domain/workgroup join status for a computer.
`static int` `getJoinStatus​(java.lang.String computerName)` Return the domain/workgroup join status for a computer.
`static Netapi32Util.LocalGroup[]` `getLocalGroups()` Get the names of local groups on the current computer.
`static Netapi32Util.LocalGroup[]` `getLocalGroups​(java.lang.String serverName)` Get the names of local groups on a computer.
`static Netapi32Util.Group[]` `getUserGroups​(java.lang.String userName)` Get groups of a given user.
`static Netapi32Util.Group[]` `getUserGroups​(java.lang.String userName, java.lang.String serverName)` Get groups of a given user on a given system.
`static Netapi32Util.UserInfo` `getUserInfo​(java.lang.String accountName)`
`static Netapi32Util.UserInfo` `getUserInfo​(java.lang.String accountName, java.lang.String domainName)`
`static Netapi32Util.Group[]` `getUserLocalGroups​(java.lang.String userName)` Get local groups of a given user.
`static Netapi32Util.Group[]` `getUserLocalGroups​(java.lang.String userName, java.lang.String serverName)` Get local groups of a given user on a given system.
`static Netapi32Util.User[]` `getUsers()` Get the names of users on a local computer.
`static Netapi32Util.User[]` `getUsers​(java.lang.String serverName)` Get the names of users on a computer.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Netapi32Util

    public Netapi32Util()

### Method Detail

#### getDCName

    public static java.lang.String getDCName()

Returns the name of the primary domain controller (PDC) on the current computer.

Returns:
  The name of the primary domain controller.

#### getDCName

    public static java.lang.String getDCName​(java.lang.String serverName,
                                             java.lang.String domainName)

Returns the name of the primary domain controller (PDC).

Parameters:
  `serverName` - Specifies the DNS or NetBIOS name of the remote server on which the function is to execute.
  `domainName` - Specifies the name of the domain.
Returns:
  Name of the primary domain controller.

#### getJoinStatus

    public static int getJoinStatus()

Return the domain/workgroup join status for a computer.

Returns:
  Join status.

#### getJoinStatus

    public static int getJoinStatus​(java.lang.String computerName)

Return the domain/workgroup join status for a computer.

Parameters:
  `computerName` - Computer name.
Returns:
  Join status.

#### getDomainName

    public static java.lang.String getDomainName​(java.lang.String computerName)

Get information about a computer.

Parameters:
  `computerName` - computer name
Returns:
  Domain or workgroup name.

#### getLocalGroups

    public static Netapi32Util.LocalGroup[] getLocalGroups()

Get the names of local groups on the current computer.

Returns:
  An array of local group names.

#### getLocalGroups

    public static Netapi32Util.LocalGroup[] getLocalGroups​(java.lang.String serverName)

Get the names of local groups on a computer.

Parameters:
  `serverName` - Name of the computer.
Returns:
  An array of local group names.

#### getGlobalGroups

    public static Netapi32Util.Group[] getGlobalGroups()

Get the names of global groups on a computer.

Returns:
  An array of group names.

#### getGlobalGroups

    public static Netapi32Util.Group[] getGlobalGroups​(java.lang.String serverName)

Get the names of global groups on a computer.

Parameters:
  `serverName` - Name of the computer.
Returns:
  An array of group names.

#### getUsers

    public static Netapi32Util.User[] getUsers()

Get the names of users on a local computer.

Returns:
  Users.

#### getUsers

    public static Netapi32Util.User[] getUsers​(java.lang.String serverName)

Get the names of users on a computer.

Parameters:
  `serverName` - Name of the computer.
Returns:
  An array of users.

#### getCurrentUserLocalGroups

    public static Netapi32Util.Group[] getCurrentUserLocalGroups()

Get local groups of the current user.

Returns:
  Local groups.

#### getUserLocalGroups

    public static Netapi32Util.Group[] getUserLocalGroups​(java.lang.String userName)

Get local groups of a given user.

Parameters:
  `userName` - User name.
Returns:
  Local groups.

#### getUserLocalGroups

    public static Netapi32Util.Group[] getUserLocalGroups​(java.lang.String userName,
                                                          java.lang.String serverName)

Get local groups of a given user on a given system.

Parameters:
  `userName` - User name.
  `serverName` - Server name.
Returns:
  Local groups.

#### getUserGroups

    public static Netapi32Util.Group[] getUserGroups​(java.lang.String userName)

Get groups of a given user.

Parameters:
  `userName` - User name.
Returns:
  Groups.

#### getUserGroups

    public static Netapi32Util.Group[] getUserGroups​(java.lang.String userName,
                                                     java.lang.String serverName)

Get groups of a given user on a given system.

Parameters:
  `userName` - User name.
  `serverName` - Server name.
Returns:
  Groups.

#### getDC

    public static Netapi32Util.DomainController getDC()

Return the domain controller for a current computer.

Returns:
  Domain controller information.

#### getDomainTrusts

    public static Netapi32Util.DomainTrust[] getDomainTrusts()

Retrieve all domain trusts.

Returns:
  An array of domain trusts.

#### getDomainTrusts

    public static Netapi32Util.DomainTrust[] getDomainTrusts​(java.lang.String serverName)

Retrieve all domain trusts for a given server.

Parameters:
  `serverName` - Server name.
Returns:
  An array of domain trusts.

#### getUserInfo

    public static Netapi32Util.UserInfo getUserInfo​(java.lang.String accountName)

#### getUserInfo

    public static Netapi32Util.UserInfo getUserInfo​(java.lang.String accountName,
                                                    java.lang.String domainName)