• Home
  • Featured Posts
    • Product Update
  • MVPSkill Events
  • MVPSkill Saturday
  • Azure
  • Microsoft 365
    • 5 นาทีกับ MVP 365
    • Copilot
    • Exchange&Outlook
    • Microsoft 365 Admin
    • Microsoft 365 Compliance
    • Microsoft 365 Life
    • Microsoft 365 Security
    • Microsoft Office
    • Microsoft Teams
    • SharePoint & OneDrive
    • Skype for Business
    • Yammer
  • Windows Client
    • Windows Security
  • Windows Server
    • Active Directory & Group Policy
    • Windows Server 2012
  • System Center
  • Tips & Technics
  • Tools
  • PowerShell
  • นอกเรื่อง IT Pro
    • Certification & Exam
    • Download E-Book
    • Free Training
    • MVP Life
    • VDO Learning
  • About Us
Search
mvpskill.com | Change the World by Contributions.
  • Home
  • Featured Posts
    • AllProduct Update

      รู้จักและใช้งาน Power Apps Collection จัดการง่ายดุจพลิกฝ่ามือ

      New Power Apps Barcode Reader Control

      รวมรวม Deck และชมย้อนหลังงาน Global Azure Bootcamp 2023

      Azure Multi Cloud

      รวมลิงค์งาน Azure Multicloud วันที่ 8 ตุลาคม 2022

  • MVPSkill Events
    • รวมรวม Deck และชมย้อนหลังงาน Global Azure Bootcamp 2023

      MVPSkill Charity Meetup 2021 – Meeting 08 Azure Security & compliance

      MVPSkill Charity Meetup 2021 – Meeting 07 Azure Backup / Azure…

      MVPSkill Charity Meetup 2021 – Meeting 06 Azure App Services (PaaS)

      MVPSkill Charity Meetup 2021 – Meeting 05 Azure Virtual Machine (IaaS)

  • MVPSkill Saturday
  • Azure
    • รวมรวม Deck และชมย้อนหลังงาน Global Azure Bootcamp 2023

      Evaluate Azure Stack HCI #2/10 “Deploy the Azure VM”

      Evaluate Azure Stack HCI #1/10 “Introduction”

      MVPSkill Charity Meetup 2021 – Meeting 08 Azure Security & compliance

      MVPSkill Charity Meetup 2021 – Meeting 07 Azure Backup / Azure…

  • Microsoft 365
    • All5 นาทีกับ MVP 365CopilotExchange&OutlookMicrosoft 365 AdminMicrosoft 365 ComplianceMicrosoft 365 LifeMicrosoft 365 SecurityMicrosoft OfficeMicrosoft TeamsSharePoint & OneDriveSkype for BusinessYammer
      copilot2

      เตรียมพร้อมใช้งาน Copilot for Microsoft 365

      รู้จักและใช้งาน Power Apps Collection จัดการง่ายดุจพลิกฝ่ามือ

      New Power Apps Barcode Reader Control

      ซ่อน SharePoint List จาก User มือซน

  • Windows Client
    • AllWindows Security

      [Tips] แก้ปัญหา Font ตัวเล็กใน Edge แบบถาวร

      Windows 10 Privacy settings

      Windows 10 มี Mode แสงสว่างหน้าจอสำหรับทำงานกลางคืน “Night Light”

      Windows 10 Timeline ความส่วนตัวที่น่ากลัว

  • Windows Server
    • AllActive Directory & Group PolicyWindows Server 2012

      MVPSkill Charity Meetup 2021 – Microsoft Azure

      How to use Best Practices Analyzer in Windows Server 2012 R2

      การกำหนด Quotas โดยใช้ File Server Resource Manager (FSRM)

      รวมคำสั่งใช้ในการจัดการ Windows Server management – Keyboard Shortcuts and Commands

  • System Center
    • EMS ตอนที่ 1 ภาพรวมของ Enterprise Mobility Suite

      MDT 2013 Update 1 ออกแล้ว

      Upgrade SC 2012 SP1 Operations Manager to SC 2012 R2

      SC 2012 R2 : Operations Manager AD Monitoring Review#1

      SC2012 R2 : Operations Manager สีเทาแห่งการนิ่งเฉย

  • Tips & Technics
    • รู้จักและใช้งาน Power Apps Collection จัดการง่ายดุจพลิกฝ่ามือ

      New Power Apps Barcode Reader Control

      ซ่อน SharePoint List จาก User มือซน

      วิธีเอาชนะข้อจํากัด 500 รายการใน Power Apps

      สร้าง QR Code Reader ด้วย Power Apps

  • Tools
    • การใช้งาน Collection ใน Power Apps

      PowerApps EP.2

      SharePoint Online Management Shell

      จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #5

      SharePoint Online Management Shell

      จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #1

      Visual Studio Code Power Shell Extension

      PowerShell w/ Visual Studio Code

  • PowerShell
    • SharePoint Online Management Shell

      จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #6

      SharePoint Online Management Shell

      จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #5

      SharePoint Online Management Shell

      จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #4

      SharePoint Online Management Shell

      จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #3

      SharePoint Online Management Shell

      จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #2

  • นอกเรื่อง IT Pro
    • AllCertification & ExamDownload E-BookFree TrainingMVP LifeVDO Learning

      [Review] การสอบ Microsoft Certification จากที่บ้าน

      video

      มาแล้วดูย้อนหลัง MVPSkill Saturday : EP_24 15 February 2563- Microsoft 365 Products Update + DEMO 

      video

      มาแล้วดูย้อนหลัง MVPSkill Saturday : EP_23 8 February 2563- Microsoft Azure Products Update + DEMO 

      [สรุปงาน] งานสัมนา Power Platform ว่าด้วยการนำ Power BI / Power Apps /…

  • About Us
Home Windows Server Active Directory & Group Policy
  • Windows Server
  • Active Directory & Group Policy
  • PowerShell

ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

By
Suttipan Passorn
-
October 18, 2012
0
1702
Facebook
LINE
Twitter
Google+
Pinterest
WhatsApp
Linkedin
Email
Print
    ก่อนนำไปประยุกต์ใช้ให้เข้าใจตรงกันก่อนนะครับ

    Domain = demo.local

    คำสั่ง PowerShell เพื่อเปลี่ยน List User Account

    Get-Help Get-ADUser -Parameter Properties(พิมพ์คำสั่งนี้เพื่อดูตัวอย่างการใช้งานคำสั่ง –Parameter ของ Get-ADUser)

     

    Get-ADUser -Filter ‘office –eq ”BKK”‘ –Properties Office,StreetAddress,City,State,Country,PostalCode | Format-Table SamAccountName,Office,StreetAddress,City,State,Country,PostalCode (พิมพ์คำสั่งนี้เพื่อให้ PowerShell ทำการ List รายชื่อของพนักงานที่อยู่ Office BKK โดยเรียงข้อมูลที่ต้องการ)

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    1. คำสั่งเกี่ยวกับ Groups

    Get-Help Get-ADGroup –Full (พิมพ์คำสั่งนี้เพื่อดูตัวอย่างการใช้งานคำสั่ง)

    Get-ADGroup -Filter *

    Get-ADGroup -Identity Sales (พิมพ์คำสั่งนี้เพื่อดู Group G-Finance)

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    Get-Help Get-ADGroupMember –Full(พิมพ์คำสั่งนี้เพื่อดูตัวอย่างการใช้งานคำสั่ง)

    Get-Help Disable-ADAccount –Full(พิมพ์คำสั่งนี้เพื่อดูตัวอย่างการใช้งานคำสั่ง)

    Get-ADGroup -Identity G-Finance | Get-ADGroupMember | Disable-ADAccount –WhatIf

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    การ Disable User ใน Group / Enable User ใน Group ด้วย Powershell

    Get-ADGroup -Identity G-Finance | Get-ADGroupMember | Disable-ADAccount

    Get-ADGroup -Identity G-Finance | Get-ADGroupMember | Enable-ADAccount

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    ตัวอย่างการ Enable User ใน Group Finance

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    การใช้งาน Powershell กับ OU

    Get-Help Get-ADOrganizationalUnit –Full (พิมพ์คำสั่งนี้เพื่อดูตัวอย่างการใช้งานคำสั่ง)

    Get-ADOrganizationalUnit -Filter * -Properties ProtectedFromAccidentalDeletion (พิมพ์คำสั่งนี้เพื่อดูว่า OU ไหนยังไม่ได้มีการป้องกันการถูกลบโดยไม่ตั้งใจ)

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    ใช้ Powershell ค้นหาเครื่อง Computer ที่เป็น Windows2008R2

    Get-ADComputer -Filter ‘OperatingSystem -like “Windows Server 2008 R2*”‘ –Properties OperatingSystem,OperatingSystemHotfix,OperatingSystemServicePack,OperatingSystemVersion

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    Get-Help ConvertTo-Html –Full(พิมพ์คำสั่งนี้เพื่อให้แปลงผลที่ได้เป็น html)

    Get-Help Out-File –Full(พิมพ์คำสั่งนี้เพื่อดูตัวอย่างการใช้งานคำสั่ง)

    คำสั่งด้านล่างนี้ใช้เพื่อสร้าง Report ออกมาเป็น .html ครับ

    Get-ADComputer -Filter ‘OperatingSystem -like “Windows Server 2008 R2*”‘ –Properties OperatingSystem,OperatingSystemHotfix,OperatingSystemServicePack,OperatingSystemVersion | ConvertTo-Html -Property Name,SID,OperatingSystem* | Out-File C:\OSList.htm

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    ใช้คำสั่ง PowerShell สร้าง OU

    ใช้คำสั่งด้านล่างนี้ครับ (ในรูปตัวอย่างผมใช้งานจาก PowerShell ISE ทำการ RUN นะครับเพราะสามารถใช้ TAB ได้)

    new-adorganizationalunit PowerShell

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    ใช้คำสั่ง PowerShell สร้าง User

    New-ADUser -SamAccountName test02 -Name “test02” -UserPrincipalName [email protected] -AccountPassword (ConvertTo-SecureString -AsPlainText “password@1” -Force) -Enabled $true -PasswordNeverExpires $true -Path “OU=Engineer,DC=demo,DC=local”

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    ผลลัพธ์ที่ได้จากการ RUN PowerShell เพื่อสร้าง User = Test02 อยู่ใน OU = Engineer ครับ ตามรูปด้านล่าง

    ตัวอย่างการใช้งาน PowerShell กับ user, OU, Groups, Computer Account

    Share this:

    • Tweet

    Like this:

    Like Loading...

    Related

    • TAGS
    • Computer Account
    • Groups
    • OU
    • ตัวอย่างการใช้งาน PowerShell กับ user
    Facebook
    LINE
    Twitter
    Google+
    Pinterest
    WhatsApp
    Linkedin
    Email
    Print
      Previous articleวิธีติดตั้ง Active Directory บน Server Core
      Next articleNote บทความที่กำลัง Share ผ่าน support.microsoft.com
      Suttipan Passorn
      http://www.mvpskill.com
      สุทธิพันธ์ ภัสสร | Suttipan Passorn | รางวัล Most Valuable Professional สาขา Management Infrastructure 2009 - ปัจจุบัน | ความรู้.....จะมีประโยชน์ก็ต่อเมื่อถูกนำมาจดบันทึกและแบ่งปัน | ผมใช้เวลาว่างเขียน Blog KB และ E-Book Free Download ขอให้มีความสุขกับการเข้ามาเยี่ยมชม Blog นี้ครับ ;)

      RELATED ARTICLESMORE FROM AUTHOR

      MVPSkill Charity Meetup 2021 – Microsoft Azure

      SharePoint Online Management Shell

      จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #6

      SharePoint Online Management Shell

      จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #5

      ค้นหาในเวป mvpskill

      New Articles

      copilot2

      เตรียมพร้อมใช้งาน Copilot for Microsoft 365

      Kumton Suttiraksiri - January 24, 2024
      0
      Microsoft Copilot for Microsoft 365 คือเครื่องมือสำหรับเพิ่มประสิทธิภาพที่ใช้ประโยชน์จาก AI และผผสมข้อมูลที่เราจัดเก็บใน Microsoft 365 ผ่าน Microsoft Graph และ Microsoft 365 Apps โดยใช้ Large language model (LLMs) มีการทำงานร่วมกับ Microsoft...

      รู้จักและใช้งาน Power Apps Collection จัดการง่ายดุจพลิกฝ่ามือ

      June 6, 2023

      New Power Apps Barcode Reader Control

      May 30, 2023

      รวมรวม Deck และชมย้อนหลังงาน Global Azure Bootcamp 2023

      May 18, 2023

      Evaluate Azure Stack HCI #2/10 “Deploy the Azure VM”

      April 22, 2023

      Monthly Archives

      Tags

      ARM Azure azure powershell azure update Charity Cloud Duangkaew Rujirawanich Exchange Flows Free E-book Office 365 for Power User; Office365 Global Microsoft 365 Developer Bootcamp json M365 Update Microsoft 365 Microsoft Teams mvpskill Mvpskill Saturday O365 Office365 Office 365 Office 365 Admin Office 365. O365 Tips Office 365;OneDrive for Business;SharePoint Online OneDrive for Business owa PowerApps Power Apps; Power Platform; Power Automate PowerBI Power Platform Powershell resource manager sharepoint Sharepoint 2013 SharePoint Online SPO TeamsTricks;microsoft Teams TeamsTricks;Teams for Admin TeamsTricks;Teams for User Template VM Windows 10 Windows server 2016 ดวงแก้ว รุจิรวนิช บทความ Remote Desktop Services เรื่อง RemoteAPP

      EDITOR PICKS

      copilot2

      เตรียมพร้อมใช้งาน Copilot for Microsoft 365

      January 24, 2024

      รู้จักและใช้งาน Power Apps Collection จัดการง่ายดุจพลิกฝ่ามือ

      June 6, 2023

      New Power Apps Barcode Reader Control

      May 30, 2023

      POPULAR POSTS

      แจกไฟล์ MS Word สำหรับทำซองผ้าป่า และใบฏีกา

      March 25, 2018

      ปัญหา windows 10 update แล้ว Font ไทยพังพินาศ

      September 1, 2016

      รู้จักกับ Active Directory และการติดตั้ง Domain Controller บน Windows 2008R2

      October 1, 2012

      POPULAR CATEGORY

      • Featured Posts304
      • Microsoft 365282
      • Tips & Technics122
      • Azure81
      • MVPSkill Events74
      • SharePoint & OneDrive72
      • Microsoft Teams70
      • Windows Server58
      • Windows Client55
      ABOUT US
      mvpskill.com | IT Professionals Community กลุ่มคนที่มีความเชี่ยวชาญและหลงใหลใน Microsoft Infrastructure เรารวมตัวกันเพื่อแบ่งปันความรุ้ความชำนาญให้กับพี่น้องร่วมอาชีพ เนื้อหาทั้งหมดไม่ว่าจะเป็น Knowledge Base, VDO, Ebook ทุกอย่างจะฟรี และฟรีตลอดไปครับ เนื้อหาและกิจกรรมงานสัมมนาที่เกิดขึ้นในสังคมแห่งนี้เกิดจากอาสาสมัคร ที่ไม่แสวงหาผลกำไรใด ๆ ทั้งสิ้น เราทำด้วยแรงกาย แรงใจ และแรงเงิน ที่พอจะมีส่วนตัวหรือได้รับการสนับสนุนจากองค์กรที่เห็นประโยชน์ของกิจกรรม หากปณิธานไม่ร่วงโรยไปตามกาลเวลา เราอยากจะไปให้ถึงการเป็นองค์การไม่แสวงหาผลกำไร (nonprofit organisation :NPO) ขอให้มีความสุขกับการแบ่งปันครับ
      FOLLOW US
      • Home
      • Featured Posts
        • AllProduct Update

          รู้จักและใช้งาน Power Apps Collection จัดการง่ายดุจพลิกฝ่ามือ

          New Power Apps Barcode Reader Control

          รวมรวม Deck และชมย้อนหลังงาน Global Azure Bootcamp 2023

          Azure Multi Cloud

          รวมลิงค์งาน Azure Multicloud วันที่ 8 ตุลาคม 2022

      • MVPSkill Events
        • รวมรวม Deck และชมย้อนหลังงาน Global Azure Bootcamp 2023

          MVPSkill Charity Meetup 2021 – Meeting 08 Azure Security & compliance

          MVPSkill Charity Meetup 2021 – Meeting 07 Azure Backup / Azure…

          MVPSkill Charity Meetup 2021 – Meeting 06 Azure App Services (PaaS)

          MVPSkill Charity Meetup 2021 – Meeting 05 Azure Virtual Machine (IaaS)

      • MVPSkill Saturday
      • Azure
        • รวมรวม Deck และชมย้อนหลังงาน Global Azure Bootcamp 2023

          Evaluate Azure Stack HCI #2/10 “Deploy the Azure VM”

          Evaluate Azure Stack HCI #1/10 “Introduction”

          MVPSkill Charity Meetup 2021 – Meeting 08 Azure Security & compliance

          MVPSkill Charity Meetup 2021 – Meeting 07 Azure Backup / Azure…

      • Microsoft 365
        • All5 นาทีกับ MVP 365CopilotExchange&OutlookMicrosoft 365 AdminMicrosoft 365 ComplianceMicrosoft 365 LifeMicrosoft 365 SecurityMicrosoft OfficeMicrosoft TeamsSharePoint & OneDriveSkype for BusinessYammer
          copilot2

          เตรียมพร้อมใช้งาน Copilot for Microsoft 365

          รู้จักและใช้งาน Power Apps Collection จัดการง่ายดุจพลิกฝ่ามือ

          New Power Apps Barcode Reader Control

          ซ่อน SharePoint List จาก User มือซน

      • Windows Client
        • AllWindows Security

          [Tips] แก้ปัญหา Font ตัวเล็กใน Edge แบบถาวร

          Windows 10 Privacy settings

          Windows 10 มี Mode แสงสว่างหน้าจอสำหรับทำงานกลางคืน “Night Light”

          Windows 10 Timeline ความส่วนตัวที่น่ากลัว

      • Windows Server
        • AllActive Directory & Group PolicyWindows Server 2012

          MVPSkill Charity Meetup 2021 – Microsoft Azure

          How to use Best Practices Analyzer in Windows Server 2012 R2

          การกำหนด Quotas โดยใช้ File Server Resource Manager (FSRM)

          รวมคำสั่งใช้ในการจัดการ Windows Server management – Keyboard Shortcuts and Commands

      • System Center
        • EMS ตอนที่ 1 ภาพรวมของ Enterprise Mobility Suite

          MDT 2013 Update 1 ออกแล้ว

          Upgrade SC 2012 SP1 Operations Manager to SC 2012 R2

          SC 2012 R2 : Operations Manager AD Monitoring Review#1

          SC2012 R2 : Operations Manager สีเทาแห่งการนิ่งเฉย

      • Tips & Technics
        • รู้จักและใช้งาน Power Apps Collection จัดการง่ายดุจพลิกฝ่ามือ

          New Power Apps Barcode Reader Control

          ซ่อน SharePoint List จาก User มือซน

          วิธีเอาชนะข้อจํากัด 500 รายการใน Power Apps

          สร้าง QR Code Reader ด้วย Power Apps

      • Tools
        • การใช้งาน Collection ใน Power Apps

          PowerApps EP.2

          SharePoint Online Management Shell

          จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #5

          SharePoint Online Management Shell

          จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #1

          Visual Studio Code Power Shell Extension

          PowerShell w/ Visual Studio Code

      • PowerShell
        • SharePoint Online Management Shell

          จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #6

          SharePoint Online Management Shell

          จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #5

          SharePoint Online Management Shell

          จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #4

          SharePoint Online Management Shell

          จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #3

          SharePoint Online Management Shell

          จัดการ SharePoint Online ให้อยู่หมัดด้วย Management Shell #2

      • นอกเรื่อง IT Pro
        • AllCertification & ExamDownload E-BookFree TrainingMVP LifeVDO Learning

          [Review] การสอบ Microsoft Certification จากที่บ้าน

          video

          มาแล้วดูย้อนหลัง MVPSkill Saturday : EP_24 15 February 2563- Microsoft 365 Products Update + DEMO 

          video

          มาแล้วดูย้อนหลัง MVPSkill Saturday : EP_23 8 February 2563- Microsoft Azure Products Update + DEMO 

          [สรุปงาน] งานสัมนา Power Platform ว่าด้วยการนำ Power BI / Power Apps /…

      • About Us
      © ข้อมูลภายในเว็บ mvpskill.com เป็นลิขสิทธิืของผู้เขียนบทความนั้นๆ
      %d bloggers like this: