Questions tagged [get-aduser]

91 questions
0
votes
1 answer

Replace email addresses with user account names in multiple files

I have a set of files that represent export of Active Directory security groups members. These files contain user email addresses. I would like to use PowerShell to scan all the files (~300) and by using Get-ADUser cmdlet find user account names…
0
votes
0 answers

Assistance needed with PowerShell Script for Get-ADUser

I am trying to write a basic PowerShell script to Get-ADUser using the UserPrincipleName property. I have tried various items and all of them fail. I have tried Get-ADUser -Properties {UserPrincipleName -eq "somename@domain.com"} and have also…
talway
  • 1
  • 1
  • 2
0
votes
0 answers

Get-aduser issue

hope you are doing well I normally use this script to return the value of extensionattribute1 $a = read-host "enter badge" get-aduser -Filter {extensionattribute1 -eq $a } -Properties * -server "Server" | format-list…
0
votes
0 answers

PowerShell | Passwd Expiration script to search specific OUs breaking on Foreach passed into a Foreach-Object

On-prem Exchange script. The first ForEach segement is not able to meld with rest of code. I believe it doesn't like the curly braces used to encase the first get-aduser clause just before the first pipe. 3 sections to this code: one churns through…
0
votes
1 answer

Expandproperty in combination with expression

im trying to get a nice output of direct reports of a user with a table. The code below gets me the output but it shows me the distinguishedName and not the displayname. Get-ADUser $user -Properties * | Select-Object -ExpandProperty DirectReports I…
PixPaw
  • 23
  • 5
0
votes
0 answers

Powershell script to get a list of ADusers, how can I exclude DISABLED accounts in AD?

So basically, I have a script that can generate a list of all the users in Active Directory, with their lastlogondate, samaccountname and name. However, I want to add a new clause to this where it EXCLUDES disabled (users). There doesn't seem to be…
0
votes
0 answers

Power Shell script to change AD Fullname attribute

I need to change the "fullname" attribute of the profile of some AD users and some OUs. I need the "fullname" attribute to be exactly the same as the "UserPrincipalName" attribute or login name. Does anyone know of any power shell scripts that can…
0
votes
1 answer

How to query the Active Directory using a list of users in a text file for a specific attribute with PowerShell

I'm somewhat basic to Powershell and use one-liner commands only to keep it short and basic. I would like to do the following: I have a list of users in a text file in the form of UserPrincipalName. I'd like to query this list of users if their…
0
votes
1 answer

Powershell Active Directory Query

New to using Powershell, so I apologize for any noobness that I show. I'm trying to extract user names, active status, Expiration Dates and Titles from Active Directory. My Powershell command is: Get-ADUser -Filter * -SearchBase "DC=XXX,DC=XXXX" | …
John Deaux
  • 21
  • 3
0
votes
3 answers

How to return properties from a list in Powershell for AD Users

Apologies for the basic question, I like to dabble in Powershell but as I don't use it frequently enough I have forgotten a lot! I have a csv list of users' employee numbers (employee.csv), which are in AD under "extensionAttribute15" I would like,…
Flicker20
  • 1
  • 2
0
votes
0 answers

Get-ADUser in function returns nothing on first run, then returns double values

I'm trying to get a simple function with get-aduser to work by filtering name like **. When I run the function the first time the return is blank. When I run it a second time it returns a double value. (only one user is present in AD) e.g.: First…
Loudy
  • 1
0
votes
1 answer

Powershell: Using "Get-ADUser -Filter SamAccountName" as variable

Code: $kullaniciisim = Get-ADUser -Filter {EmployeeNumber -eq '23214214'} | Select-Object SamAccountName $kullaniciisim Input: SamAccountName -------------- b.ozturk I want $kullaniciisim to be b.ozturk not SamAccountName --------------…
Berke the Vulpes
  • 45
  • 1
  • 1
  • 6
0
votes
1 answer

How do I set the value of a variable in Powershell using Get-ADUser?

I'm trying to update Active Directory with info from a csv file generated by one of our client-facing systems. I'm storing the info, an ID#, in the facsimileTelephoneNumber AD Attribute (don't ask why). Here's where it's getting tricky. If there…
JamesMay
  • 3
  • 3
0
votes
2 answers

C#. Write PowerShell output as a dictionary

I am stuck with a simple task and need community help, please. I'm running a PowerShell script in a C# code and need to convert the output to a dictionary. The code is private void button_datecheck_Click(object sender, EventArgs e) { var…
0
votes
1 answer

How to get nested properties of an AD object using Powershell?

I ran the below cmdlet with the intent to get all the properties of the AD user. Get-ADUser -Identity targetuser -Properties * But I'm only getting fewer properties, not all of them (refer screenshot). I'm assuming that the remaining properties…