Add the local computer to a domain or workgroup. (Add-Computer)

   

# NAME
Add-Computer

# SYNOPSIS
Add the local computer to a domain or workgroup.

# SYNTAX
Add-Computer [-DomainName] <string> [-Credential <PSCredential>] [-OUPath <string>] [-Server <string>] [-Unsecure] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]

Add-Computer [-WorkGroupName] <string> [-Credential <PSCredential>] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]

# DESCRIPTION
The Add-Computer cmdlet adds the local computer to a domain or workgroup, or moves it from one domain to another. It also creates a domain account if the computer is added to the domain without an account.

You can use the parameters of this cmdlet to specify an organizational unit (OU) and domain controller or to perform an unsecure join.

To get the results of the command, use the Verbose and PassThru parameters.

# PARAMETERS
-Credential <PSCredential>
Specifies a user account that has permission to perform this action. The default is the current user.

Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.

Required? false
Position? named
Default value Current User Account Credentials
Accept pipeline input? false
Accept wildcard characters? false

-DomainName <string>
Specifies a domain for the computer account. This parameter is required.

Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false

-OUPath <string>
Specifies an organizational unit (OU) for the domain account. Enter the full distinguished name of the OU. The default value is the default OU for machine objects in the domain.

Required? false
Position? named
Default value The default OU for machine objects for in the domain
Accept pipeline input? false
Accept wildcard characters? false

-PassThru [<SwitchParameter>]
Returns the results of the command. By default, this cmdlet does not generate any output.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Server <string>
Specifies the name of a domain controller that adds the computer to the domain. Enter the name in DomainName\ComputerName format. The default is the local computer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Unsecure [<SwitchParameter>]
Performs an unsecure join.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WorkGroupName <string>
Specifies the name of a work group for the computer. If you omit this parameter, the computer is joined to a domain.

Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm [<SwitchParameter>]
Prompts you for confirmation before executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-WhatIf [<SwitchParameter>]
Describes what would happen if you executed the command without actually executing the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

# INPUTS
None
You cannot pipe objects to Add-Computer.

# OUTPUTS
Microsoft.PowerShell.Commands.ComputerChangeInfo
When you use the PassThru parameter, Add-Computer returns a ComputerChangeInfo object. Otherwise, this cmdlet does not generate any output.

# NOTES

# EXAMPLE 1

C:\PS>add-computer -domainname Domain01; restart-computer

# Description
-----------
These commands add the local computer to the Domain01 domain using the credentials of the current user.

The first command adds the computer to the domain. The second command uses the Restart-Computer cmdlet to restart the computer, which completes the join operation. The semi-colon (;) separates the two commands.

# EXAMPLE 2

C:\PS>add-computer -workgroupname WORKGROUP-A

# Description
-----------
This command adds the local computer to the Workgroup-A workgroup.

# EXAMPLE 3

C:\PS>add-computer -DomainName Domain01 -Server Domain01\DC01 -passthru -verbose

# Description
-----------
This command adds the local computer to the Domain01 domain by using the Domain01\DC01 domain controller.

The command uses the PassThru and Verbose parameters to get detailed information about the results of the command.

# EXAMPLE 4

C:\PS>Add-Computer -domainname Domain02 -OUPath OU=testOU,DC=domain,DC=Domain,DC=com

# Description
-----------
This command adds the Server01 and Server02 computers to the Domain02 domain. It uses the OUPath command to specify the organization unit for the new accounts.

# EXAMPLE 5

C:\PS>Add-Computer -domainname Domain02 -cred Domain02\Admin02 -passthru

# Description
-----------
This command adds the local computer to the Domain02 domain by using the credentials of a domain administrator. The command uses the PassThru parameter to generate a brief report about the results of the command.

RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkID=135194
Checkpoint-Computer
Remove-Computer
Restart-Computer
Restore-Computer
Stop-Computer
Test-Connection

C:\Windows>powershell get-help Remove-Computer -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2014 Microsoft Corporation.

OS: Windows-10 / Windows-8.1 & 8 / Windows-7 & Vista / Windows Server 2008-2016
»»»» ColorConsole



 


... Home  
... Impressum
... ColorConsole

... CMD
... Netsh-XP
... Netsh-7
... Netsh-Vista
... Powershell









Download the Windows 7 Starter, Home (Basic Premium), Professional und Ultimate!

... facebook.de
0.062
Wo kann ich in Windows-10 Downloaden?  / Kann ich die Desktop Icons, bzw. das Symbollayout auch bei Windows-7 speichern?  / Quick dock and compare the windows under Windows 8.1 / 10!  / Habe ein Problem mit der Facebook.de Pinnwand, meine Freunde habe ich blockiert, wie kann ich diese wieder für meine Pinnwand freischalten?  / Enable screen saver password in Windows 10, how to turn off?  / Freigegebene Ordner und Festplatten in Windows-7 ändern, hinzufügen, entfernen!  / Office 2003 installiert, alles funktioniert in Win-7, aber Outlook 2003 nicht?  / Kann man in Windows 8.1/10 das automatische Ausklappen des Verzeichnisbaumes in MS-Explorer deaktivieren?  / My Magazin vom Start (Homescreen) am Android Handy entfernen!  / Was ist ein Bootmanager?  / Kann man die Windows 7 Indizierung deaktivieren, bzw. anpassen?  / I would like to see the full name of the folder in the tab!  /