How to Create AD Users from CSV

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

ความคิดเห็น • 44

  • @ServerAcademy
    @ServerAcademy  4 ปีที่แล้ว +2

    Hey Guys - so I messed up at 14:49 and forgot to include "-surname $user.'Last Name'" after "-GivenName" - please be sure to include that or see my tutorial page for the correct syntax.

    • @marlonmorales951
      @marlonmorales951 4 ปีที่แล้ว

      When I run your syntax, Account is created as disabled. I have another question, I was able to add the User Logon name, but script did not select my UPN @example.com ... Thanks for your help and good tutorial

    • @ServerAcademy
      @ServerAcademy  4 ปีที่แล้ว

      @@marlonmorales951 You have to add -enabled to the end of the command otherwise it will default to creating disabled users. UPN is inferred I belive.

  • @kevinandgina9101
    @kevinandgina9101 5 หลายเดือนก่อน

    I really appreciate this as I am in an AD DS Class for online Bachelors in cyber security and there is absolutely no direction and no instructions and I am new to this part of the IT world. So thank you for the videos and keep them coming.

  • @michaelrichardson8467
    @michaelrichardson8467 4 ปีที่แล้ว +1

    Just getting into scripting and some of this went over my head, like the brackets towards the end. But honestly for never even writing a script successfully after watching this I was able too, and not just using your files, which I did appreciate for creating the .csv and all the commands and their parameters.
    I can not thank you enough tools and videos like this are easier for me to digest than trying to read something.
    I work for a small IT company and we have a client that has ad and all their users were still using one account to login to every machine 🤦‍♂️🤦‍♂️
    I was not only able to come in and add 30 users in five minutes but was able to set up certain users with roaming profiles as well.
    Seriously thank you for this. This video really opened up my understanding

    • @ServerAcademy
      @ServerAcademy  4 ปีที่แล้ว

      Awesome!! Lol at your story about AD and all the users used a single user account. Fix them up!

  • @giiretech8005
    @giiretech8005 4 ปีที่แล้ว +1

    I like that idea its awesome and l also one of your student on Udemy Active Directory & Group Policy Labs. You are a good instructor thanks i really appreciate that

  • @davem45
    @davem45 11 หลายเดือนก่อน

    great tutorial! Is there any opportunity to get any 1:1 support? I would like to make a few modifications, but honestly, I'm not sure where to start, and my PowerShell knowledge is very beginner. Thanks

  • @potolozi3983
    @potolozi3983 4 ปีที่แล้ว +2

    Extremely valuable. Thank you for making this kind of content available!

  • @learneasyfasterwhatyouneed250
    @learneasyfasterwhatyouneed250 3 ปีที่แล้ว

    Great content about Power Shell and created users via CSV with PowerShell

  • @rickyray2794
    @rickyray2794 ปีที่แล้ว

    Thanks this helped a lot. the only thing is I got an error at the steps starting at 19:05. Where did "Add Groups (csv)" come from? Is that the name of your csv file?

  • @sanjayjoshi7605
    @sanjayjoshi7605 3 ปีที่แล้ว

    Your presentation skills are very much appreciable. Thanks, buddy!

  • @streetglidescott6424
    @streetglidescott6424 4 ปีที่แล้ว +1

    Very helpful, thanks! Subscribed, set notification and reminder! Can you help with 2 things? 1) Daily import from HR Provided DSV -- How to avoid overwriting? 2) If we already have user John Doe (Johns) and hire John Dalton, John Dapper and John Dapplen , how can I automate the login creation to reflect John Dalton =johnda, john dapper = johndap and John Dapplen = johndapp (if login exists, add an additional character to last initial value)

    • @ServerAcademy
      @ServerAcademy  4 ปีที่แล้ว

      Definitely! I would write a function with a name something like "DoesUserExist" and I would have it return either true or false. Inside of that function you need to run a Get-ADUser command and search for the user you want to create. If you get a result, return true, else return false.
      When you call the function, if it returns true then you append a number to the user name and rerun the check to see if that user exist. If it does, then you increment the number and check again.
      For this part you would probably want to use a while loop. Something like while ($UsernameIsInUse) { ... code to increment number on user name ... }
      Hard to convey over comments - but hopefully this helps.

  • @jbway86
    @jbway86 ปีที่แล้ว

    Fyi. Csv files with tabs do work. You have to cast it when importing csv. Forgot the syntax. I think its [t`] (letter t and a back tick).

  • @brandonluciano8133
    @brandonluciano8133 4 ปีที่แล้ว +1

    Thanks for this video, really clear and informative. really appreciate it.

  • @sheransheran7976
    @sheransheran7976 2 ปีที่แล้ว

    useful video, but plz how can i create OU's in the same way?? i have been tried for a long time but it has not worked! 😪.
    I need to create excel.csv file and then i need powershel script to run it

  • @grandtheftautovideos9938
    @grandtheftautovideos9938 2 ปีที่แล้ว

    How can multiple group memberships be defined/separated in the spreadsheet? With a space, comma, or semicolon?

  • @pa1089
    @pa1089 4 ปีที่แล้ว +2

    Hello Paul. Thank you for the video really helpful. How would I create exchange mailboxes for the same users once the AD users are created? Do I need to use for each syntax again? Thank you

    • @ServerAcademy
      @ServerAcademy  4 ปีที่แล้ว +2

      What I would do is after block at line 55-59 where we add the user to the groups, I would call the "New-MailBox" command. Of course this may require you to run the script from your exchange server assuming you have on-premises. I think it would also be wise to check if the user was actually created first (i.e. not a duplicate username) before creating the mail box or even adding them to the group as you don't want to accidentally add the wrong user to a group or create mailbox for the wrong user. Off the top of my head a try / catch combined with get-aduser would help you accomplish this.

    • @pa1089
      @pa1089 4 ปีที่แล้ว +1

      Thank you very much Paul for the reply. So just the “New-Mailbox” command with $Username after that?
      Can you please provide me with an example command if possible?
      Thank you again

    • @ServerAcademy
      @ServerAcademy  4 ปีที่แล้ว +1

      Definitely refer to the Microsoft docs (link below) but its a long command like the New-ADUser command: docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/new-mailbox?view=exchange-ps#examples .. There are also examples on that page like this:
      New-Mailbox -UserPrincipalName chris@contoso.com -Alias chris -Database "Mailbox Database 1" -Name ChrisAshton -OrganizationalUnit Users -Password $password -FirstName Chris -LastName Ashton -DisplayName "Chris Ashton" -ResetPasswordOnNextLogon $true

    • @pa1089
      @pa1089 4 ปีที่แล้ว +1

      Thank you I will cross check the documentation too but why would I need to put in password parameter again as it was created earlier?

    • @ServerAcademy
      @ServerAcademy  4 ปีที่แล้ว +2

      @@pa1089 I did some more looking into this and it appears that the New-MailBox command is not what you want in this scenario. This is because the new-mailbox ALSO creates a new AD user (in our script we already did that) and that is why you saw the $password variable.. So what you actually want is Enable-Mailbox - This command allows you to create mailboxes for existing users who don't have a mailbox yet...
      docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/enable-mailbox?view=exchange-ps#examples
      So something like:
      Enable-Mailbox -identity $UserName

  • @priyaangadi8603
    @priyaangadi8603 3 ปีที่แล้ว

    Thank you so much sir... Please add the vedio same like this for active directory termination

  • @kakashiHatake-is8em
    @kakashiHatake-is8em 2 ปีที่แล้ว

    ADUsers : The term 'ADUsers' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
    spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:2 char:1
    + ADUsers = Import-CSV C:\Users\Administrator\Desktop
    + ~~~~~~~
    + CategoryInfo : ObjectNotFound: (ADUsers:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    Facing this error

  • @satyendrayadav2837
    @satyendrayadav2837 3 ปีที่แล้ว

    how to get AD user last logon details using csv (in csv username exist)

  • @2ndbase330
    @2ndbase330 4 ปีที่แล้ว +1

    IF you could explain why you indent certain line and not others

    • @ServerAcademy
      @ServerAcademy  4 ปีที่แล้ว

      Hey - this is for formatting purposes only so it makes it easier to read. More information here: en.wikipedia.org/wiki/Indentation_style#:~:text=In%20computer%20programming%2C%20an%20indentation,recommended%20for%20maximum%20code%20readability.

  • @DrkWng17
    @DrkWng17 ปีที่แล้ว

    Can you do this with Python?

  • @gibson7654
    @gibson7654 4 ปีที่แล้ว

    5:20 my $dialog command turns red instead of green and I don't get that list. Instead nothing happens when I press enter.

    • @honestphiri5011
      @honestphiri5011 4 ปีที่แล้ว

      did you manage to resolve this?

    • @gibson7654
      @gibson7654 4 ปีที่แล้ว

      @@honestphiri5011 I have not. Sorry.

  • @afghanoutsider
    @afghanoutsider 6 หลายเดือนก่อน

    it is so complicated out of my head

  • @slowfreak3718
    @slowfreak3718 4 ปีที่แล้ว +1

    thank you!

  • @justme-iz7ec
    @justme-iz7ec 2 ปีที่แล้ว

    smoothe

  • @ashishsingh4693
    @ashishsingh4693 4 ปีที่แล้ว +1

    Thank. Brooooooo

    • @ServerAcademy
      @ServerAcademy  4 ปีที่แล้ว

      Sure thing brrrrrrrooooo :D

    • @ashishsingh4693
      @ashishsingh4693 4 ปีที่แล้ว

      @@ServerAcademy bro how extract hardware and software details through powershell remotely

  • @nallakulasatyavenkatesh1001
    @nallakulasatyavenkatesh1001 2 ปีที่แล้ว

    Thanks :pray::pray::pray:

  • @nicolaspivaut6362
    @nicolaspivaut6362 2 ปีที่แล้ว

    WriteHost : Le terme «WriteHost» n'est pas reconnu comme nom d'applet de commande, fonction,
    fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès
    existe, vérifiez que le chemin d'accès est correct et réessayez.
    Au caractère C:\script3final.ps1:59 : 13
    + WriteHost "Added $Username to $_ group" # Log to console
    + ~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (WriteHost:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException