Powershell Get-Aduser report FASTER!

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 35

  • @sanofamotivation
    @sanofamotivation 2 года назад +1

    Nice 👍 I already know about it...but I have learnt the value of -notypeinformation Thank you!!

  • @yasarnawab7127
    @yasarnawab7127 3 года назад

    nice way to explain, calm way without any panic, this is the style to teach.

  • @shyamsahaji5333
    @shyamsahaji5333 3 года назад

    Hi Dran, Thank you for sharing easy steps to get the report, this was my first attempt to learn to script, can you please create a video for extracting a single GPO from AD.

  • @muzammilmahmoodi1519
    @muzammilmahmoodi1519 3 года назад +1

    Hi it was nice informative, but please try to zoom your screen time to time to see the commands properly
    Thanks 👍

    • @drantrix3950
      @drantrix3950  3 года назад

      Thank you Muzammil! Sure I will do that here after 👍👍🙂

  • @petebuka
    @petebuka 4 года назад +1

    Thank you very much. How to filter out disabled users? Great Video

    • @drantrix3950
      @drantrix3950  4 года назад

      This will give you the disabled users list in a csv file
      Get-ADUser -Filter * -Properties * | where enabled -EQ false | select -Property name,samaccountname,enaled | Export-Csv c:\temp\Disabled_Users.csv -NoTypeInformation

  • @sumvlog_89
    @sumvlog_89 3 года назад +1

    using bulk mail id's need to fetch user id's. Can you help on this ?

    • @drantrix3950
      @drantrix3950  3 года назад

      Sure. Try the below. YOu need to keep all your email IDs in a notepad placed in C:\temp\Emails.txt and then run the below. It will take each email IDs and find out the user ID it matches in AD and give you output in csv file.
      Output will have the belwo informail
      EmailAddress SamaccountName
      ------------ --------------
      alpha@dran.com Alpha
      bravo@dran.com Bravo
      charlie@dran.com Charlie
      dran@dran.com Dran
      Here's the script:
      $MailIDs = Get-Content C:\temp\Emails.txt
      $UserIDs = Foreach($MailID in $MailIDs)
      {
      Get-ADUser -Filter * -Properties * | Where EmailAddress -EQ $MailID | select EmailAddress,SamaccountName
      }
      $UserIDs | Export-Csv c:\temp\UserIDs.csv -NoTypeInformation

  • @mohamedaziff1931
    @mohamedaziff1931 2 года назад

    Hello, Dran trix
    In real time we need to get the particular users details ( some 50 no. of users). How to do that?

    • @drantrix3950
      @drantrix3950  Год назад

      Hi Aziff,
      I'm sure it's too long, I've started becoming active in YT now. Let me know if you still help, thanks!

  • @imrannawab2096
    @imrannawab2096 4 года назад

    Nice work. Just one question. How to extract similar details for few selective users. Example i have 10 users but i only want details for user01, user02 and user03.

    • @drantrix3950
      @drantrix3950  Год назад

      I'm sure it's too long, I've started becoming active in YT now. Let me know if you still help, thanks!

  • @BonesD23
    @BonesD23 4 года назад +1

    Great Video

  • @sampletext9065
    @sampletext9065 2 года назад

    Hi Dran how to export ad computers with name and description, site OU and location of all computer objects

    • @drantrix3950
      @drantrix3950  Год назад

      Hi, I'm sure it's too long, I've started becoming active in YT now. Let me know if you still help, thanks!

  • @fouadgbg9725
    @fouadgbg9725 4 года назад

    What about if I need to export the list of users from a security group, I have tried the following Command and the csv was empty
    Get-ADUser -Filter * -SearchBase "CN=test,OU=Azure Groups,OU=Security Groups,DC=tes,DC=co,DC=uk” -Properties * |`Select-Object Name, UserPrincipalName, Mail |`Export-CSV C:\extract\Email.csv
    I have added all the users within this security group, thanks

    • @drantrix3950
      @drantrix3950  4 года назад +1

      Hi Fouad,
      It's about your requirements. If you just need members of a particular security group - for example, "Security Group 1", you can run this: Get-ADGroupMember "Security group 1" | select -Property name,SamAccountName | Export-Csv c:\temp\GroupMembers.csv -NoTypeInformation

    • @fouadgbg9725
      @fouadgbg9725 4 года назад +1

      @@drantrix3950 : you are a star, this has worked, I highly recommend you, Much appreciate that.
      One last question, if I would like to get the same command but with o365 and retrieve the SamAccountName, have you got any clue within the PowerShell.
      thanks in advance

    • @drantrix3950
      @drantrix3950  4 года назад

      @@fouadgbg9725 Thank you so much! that was kind :) I wish I had o365 admin access, but unfortunately I dont. Yet, I found this site as helpful for your query. Please try this one www.sharepointdiary.com/2019/04/get-office-365-group-members-using-powershell.html

    • @fouadgbg9725
      @fouadgbg9725 4 года назад

      Sorry to bother you again, in regards the Attributes; First Name, Last Name, and email address, I have tried all the possibilities that I can gues and the result is no luck,
      PS C:\> Get-ADGroupMember "test" | select -Property LastName, email,SamAccountName
      LastName email SamAccountName
      -------- ----- --------------
      {} {} ftest
      PS C:\> Get-ADGroupMember "test" | select -Property fName, email,SamAccountName
      fName email SamAccountName
      ----- ----- --------------
      {} {} ftest
      PS C:\> Get-ADGroupMember "test" | select -Property fName, emailAddress,SamAccountName
      fName emailAddress SamAccountName
      ----- ------------ --------------
      {} {} ftest
      PS C:\> Get-ADGroupMember "test" | select -Property fName, mail,SamAccountName
      fName mail SamAccountName
      ----- ---- --------------
      {} ftest

    • @fouadgbg9725
      @fouadgbg9725 4 года назад

      @@drantrix3950 regards the office 365 Power Export; I am after exporting users from each individual Assigned Licenses, but again, you did your best, and I have researched all over and no luck, thanks anyway about this reply

  • @rnadimpalli9172
    @rnadimpalli9172 4 года назад

    Good Video Thankyou very much! How to fetch the all users and assigned licenses(SKUPartNumber) to them? Thanks in advance!

    • @drantrix3950
      @drantrix3950  4 года назад

      Hi Nadimpalli, I'm not sure how but I'll certainly look into that and find that out for you, thanks!

  • @sudheerandhe
    @sudheerandhe Год назад

    Thanks for this video. I've a similar task to do, but not able to write the proper code. I should run the command for multiple ad users using csv file, but unfortunately I end up with errors in powershell. Below is the code which is working for single user, whereas I should achive this for 100+ users... Kindly help me out...
    "Get-ADUser -Identity olduser -Properties memberof | Select-Object -ExpandProperty memberof | Add-ADGroupMember -Members newuser"

    • @drantrix3950
      @drantrix3950  Год назад +1

      If I understand it correctly, you are trying to get all the security groups from an old user and adding the new users who are taken from the CSV file to the same security groups. Correct me otherwise, I'll give it a try from my side and let you know

    • @sudheerandhe
      @sudheerandhe Год назад +1

      @@drantrix3950 You got it correctly but minor missing thing was "from multiple old users to multiple new users"...😀

    • @drantrix3950
      @drantrix3950  Год назад

      Gotcha, let me try getting it

    • @drantrix3950
      @drantrix3950  Год назад

      Hi Sudheer,
      Script is ready, I just replied to you email, pls check and let me know if it works :)

  • @kunalr_ai
    @kunalr_ai 2 года назад +1

    thx

  • @KHalilovLearn
    @KHalilovLearn 2 года назад

    what the music in start vidio ?

    • @drantrix3950
      @drantrix3950  Год назад

      Hi, it is "arms dealer - Anno domini beats"