EN
Данное содержимое не доступно на вашем языке, используйте версию на английском языке.

UnjoinDomainOrWorkgroup method of the Win32_ComputerSystem class

The UnjoinDomainOrWorkgroup method removes a computer system from a domain or workgroup.

This topic uses Managed Object Format (MOF) syntax. For more information about using this method, see Calling a Method.

Syntax


uint32 UnjoinDomainOrWorkgroup(
  [in]  string Password,
  [in]  string UserName,
  [in]  uint32 FUnjoinOptions = 0
);

Parameters

Password [in]

If the UserName parameter specifies an account name, the Password parameter must point to the password to use when connecting to the domain controller. Otherwise, this parameter must be NULL.

Note  Password must use a high authentication level, not less than RPC_C_AUTHN_LEVEL_PKT_PRIVACY, when connecting to Winmgmt or CoSetProxyBlanket on the IWbemServices pointer. If local to Winmgmt, this is not a concern.

UserName [in]

Pointer to a constant null-terminated character string that specifies the account name to use when connecting to the domain controller. Must specify a domain NetBIOS name and user account, for example, domain\user. If this parameter is NULL, the caller context is used.

Windows Server 2003:  Using the user principal name (UPN) in the form of user@domain is also supported.

Note  UserName must use a high authentication level, not less than RPC_C_AUTHN_LEVEL_PKT_PRIVACY, when connecting to Winmgmt or CoSetProxyBlanket on the IWbemServices pointer. If local to Winmgmt, this is not a concern.

FUnjoinOptions [in]

Set of bit flags defining the unjoin options.

ValueMeaning
0

Default. No options.

NETSETUP_ACCT_DELETE
2

Disable the Active Directory account after the unjoin operation, but do not delete the account.

 

Remarks

After calling this method, restart the affected computer to apply the changes.

Examples

The Unjoin a Computer from a Domain VBScript sample unjoins the local computer from its current domain and disables the computer account.

The Unjoin a Computer from a Domain using VBS script sample unjoins a specified computer from a domain. .

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Namespace

\root\CIMV2

MOF

CIMWin32.mof

DLL

CIMWin32.dll

See also

Win32_ComputerSystem
JoinDomainOrWorkgroup method

 

 

Показ:
© 2014 Microsoft