Microsoft®OfficialCourseModule4自动化AD域服务管理刘道军老师主讲如有疑问请与我联系:10804072ModuleOverview•Lesson1:使用命令行工具管理ADDS•Lesson2:使用WindowsPowerShell管理ADDS•Lesson3:使用WindowsPowerShell执行大批量操作•实验:使用WindowsPowerShell自动化管理ADDSLesson1:UsingCommand-lineToolsforADDSAdministration•BenefitsofUsingCommand-LineToolsforADDSAdministration•WhatIsCsvde?•WhatIsLdifde?•WhatAreDSCommands?BenefitsofUsingCommand-LineToolsforADDSAdministrationCommand-linetoolsallowyoutoautomateADDSadministrationBenefitsofusingcommand-linetools:•Fasterimplementationofbulkoperations•CustomizedprocessesforADDSadministration•ADDSadministrationonservercoreWhatIsCsvde?csvde–i–ffilename–kUsecsvdetoexportobjectstoa.csvfile:•-ffilename•-dRootDN•-pSearchScope•-rFilter•-lListOfAtrributesUsecsvdetocreateobjectsfroma.csvfile:ADDSImportExportcsvde.exefilename.csvWhatIsLdifde?UseldifdetoexportobjectstoaLDIFfile:•-ffilename•-dRootDN•-rFilter•-pSearchScope•-lListOfAttributesToInclude•-oListOfAttributesToExcludeUseldifdetocreate,modify,ordeleteobjects:ldifde–i–ffilename–kExportldifde.exefilename.ldifImportADDSWhatAreDSCommands?WindowsServer2012includesds*commandsthataresuitableforuseinscripts•Examples•Tomodifythedepartmentofauseraccount,type:•Todisplaytheemailofauseraccount,type:•Todeleteauseraccount,type:•Tocreateanewuseraccount,type:Dsmodusercn=JoeHealy,ou=Managers,dc=adatum,dc=com–deptITDsgetusercn=JoeHealy,ou=Managers,dc=adatum,dc=com–emailDsrmcn=JoeHealy,ou=Managers,dc=adatum,dc=comDsaddusercn=JoeHealy,ou=Managers,dc=adatum,dc=comMicrosoft®OfficialCourseThanks!如有疑问请与我联系:10804072Microsoft®OfficialCourseModule4自动化AD域服务管理刘道军老师主讲如有疑问请与我联系:10804072Lesson2:UsingWindowsPowerShellforADDSAdministration•UsingWindowsPowerShellCmdletstoManageUserAccounts•UsingWindowsPowerShellCmdletstoManageGroups•UsingWindowsPowerShellCmdletstoManageComputerAccounts•UsingWindowsPowerShellCmdletstoManageOUsUsingWindowsPowerShellCmdletstoManageUserAccountsCmdletDescriptionNew-ADUserCreatesuseraccountsSet-ADUserModifiespropertiesofuseraccountsRemove-ADUserDeletesuseraccountsSet-ADAccountPasswordResetsthepasswordofauseraccountSet-ADAccountExpirationModifiestheexpirationdateofauseraccountUnlock-ADAccountUnlocksauseraccountafterithasbecomelockedaftertoomanyincorrectloginattemptsEnable-ADAccountEnablesauseraccountDisable-ADAccountDisablesauseraccountNew-ADUserStenFaerch–AccountPassword(Read-Host–AsSecureStringEnterpassword)-DepartmentITUsingWindowsPowerShellCmdletstoManageGroupsCmdletDescriptionNew-ADGroupCreatesnewgroupsSet-ADGroupModifiespropertiesofgroupsGet-ADGroupDisplayspropertiesofgroupsRemove-ADGroupDeletesgroupsAdd-ADGroupMemberAddsmemberstogroupsGet-ADGroupMemberDisplaysmembershipofgroupsRemove-ADGroupMemberRemovesmembersfromgroupsAdd-ADPrincipalGroupMembershipAddsgroupmembershiptoobjectsGet-ADPrincipalGroupMembershipDisplaysgroupmembershipofobjectsRemove-ADPrincipalGroupMembershipRemovesgroupmembershipfromanobjectNew-ADGroup–NameCustomerManagement–Pathou=managers,dc=adatum,dc=com–GroupScopeGlobal–GroupCategorySecurityAdd-ADGroupMember–Name“CustomerManagement”–MembersJoeUsingWindowsPowerShellCmdletstoManageComputerAccountsCmdletDescriptionNew-ADComputerCreatesnewcomputeraccountsSet-ADComputerModifiespropertiesofcomputeraccountsGet-ADComputerDisplayspropertiesofcomputeraccountsRemove-ADComputerDeletescomputeraccountsTest-ComputerSecureChannelVerifiesorrepairsthetrustrelationshipbetweenacomputerandthedomainReset-ComputerMachinePasswordResetsthepasswordforacomputeraccountNew-ADComputer–Name“LON-SVR8”-Pathou=marketing,dc=adatum,dc=com-Enabled$trueTest-ComputerSecureChannel-RepairUsingWindowsPowerShellCmdletstoManageOUsCmdletDescriptionNew-ADOrganizationalUnitCreatesOUsSet-ADOrganizationalUnitModifiespropertiesofOUsGet-ADOrganizationalUnitViewspropertiesofOUsRemove-ADOrganizationalUnitDeletesOUsNew-ADOrganizationalUnit–Name“Sales”–Pathou=marketing,dc=adatum,dc=com–ProtectedFromAccidentalDeletion$trueMicrosoft®OfficialCourseThanks!如有疑问请与我联系:10804072Microsoft®OfficialCourseModule4自动化AD域服务管理刘道军老师主讲如有疑问请与我联系:10804072Lesson3:PerformingBulkOperationswithWindowsPowerShell•WhatAreBulkOperations?•Demonstration:UsingGraphicalToolstoPerformBulkOperations•QueryingObjectswithWindowsPowerShell•ModifyingObjectswithWindowsPowerShell•WorkingwithCSVFiles•Demonstration:PerformingBulkOperationswithWindowsPowerShellWhatAreBulkOperations?•Abulkoperationisasingleactionthatchangesmultipleobjects•Samplebulkoperations•Createuseraccountsbasedondatainaspreadsheet•Disableallaccountsnotusedinsixmonths•Renamethedepartmentformanyusers•Youcanperformbulkoperationsbyusing:•Graphicaltools•Command-linetools•ScriptDemonstration:UsingGraphicalToolstoPerformBulkOperationsInthisdemonstration,youwillseehowto:•Createaqueryforallusers•ConfiguretheCompanyattributeforallusers•VerifythattheCompanyattributehasbeenmodifiedQueryingObjectswithWindowsPowerShellParameterDescriptionSearchBaseDefinestheADDSpathtobeginsearchingSearchScopeDefinesatwhatlevelbelowtheSearchBaseasearchshouldbeperformedResultSetSizeDefineshowmanyobjectstoreturninresponsetoaqueryProp