sherifdd

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    sherifdd
    Member
    Rems;n494079 wrote:

    Import-Module ActiveDirectory

    $search=’dc=xyz,dc=abc’

    [email protected](
    ‘Name’,
    ‘sAMAccountName’,
    ‘Description’,
    ‘Enabled’,
    ‘created’,
    ‘modified’,
    @{n=”MemberOf”;e={($_.memberof | %{(Get-ADGroup $_).sAMAccountName}) -join “;”}},
    ‘LastLogonDate’,
    ‘LockedOut’
    )

    Get-ADUser -filter * -Properties * -SearchBase $search | select $props | export-Csv “C:new.csv” -notypeinfo -encoding “UTF8”

    [/Code][/QUOTE]

    Tks for the code, but, could you help me use this CSV to create a new user, a member of the same groups[Code]
    Import-Module ActiveDirectory

    $search=’dc=xyz,dc=abc’

    [email protected](
    ‘Name’,
    ‘sAMAccountName’,
    ‘Description’,
    ‘Enabled’,
    ‘created’,
    ‘modified’,
    @{n=”MemberOf”;e={($_.memberof | %{(Get-ADGroup $_).sAMAccountName}) -join “;”}},
    ‘LastLogonDate’,
    ‘LockedOut’
    )

    Get-ADUser -filter * -Properties * -SearchBase $search | select $props | export-Csv “C:new.csv” -notypeinfo -encoding “UTF8”

    [/Code]

    Tks for the code, but, could you help me use this CSV to create a new user, a member of the same groups

Viewing 1 post (of 1 total)