Questions tagged [get-aduser]

91 questions
0
votes
1 answer

AD users that have specific word in the description field via Powershell

I am new to PowerShell and I am trying to extract username and name of users that contain a word or specific words in the description field of an AD user. In the description field we have added user job titles and I am trying to search for specific…
S.Mahmood
  • 129
  • 11
0
votes
1 answer

Get-ADPrincipalGroupMembership including "managed by"

i have a skript to check a users groups but what would be nice to have is the owner of the group ("managed by") as well. $Username = Read-Host "Enter User ID" $date = Get-Date -format "yyyy-MM-dd" $name = Get-ADUser "$Username" | select…
DWeber
  • 1
0
votes
1 answer

Replace AD attribute value with csv file header values

I want to replace AD attribute "userPrincipalName" value according to CSV file header value here is what csv file(group.csv) contains sAMAccountName -------------- test.user1 test.user2 below the script $data = Import-Csv -Path .\group.csv…
khamro
  • 5
  • 3
0
votes
2 answers

Get AD user properties from Active Directory

I am trying to filter the values of a property in Active Directory. I tried: Get-ADUser -filter * -Properties physicalDeliveryOfficeName | Where-Object (($_.physicalDeliveryOfficeName -like "NICE")) | Select-Object physicalDeliveryOfficeName, name…
Steph_69
  • 1
  • 4
0
votes
1 answer

Why not displaying the correct date? powershell output c# label

How can I fix this problem? I'm trying to display powershell script output on a label. The PowerShell code working fine when I run it, but if I have to get the output to display nothing display only the error message what I write, If I change the…
Tamás
  • 25
  • 4
0
votes
1 answer

How can I pull usernames from AD using powershell and the email addresses

I can pull a single username from AD by searching for the email address, but I would like to pull multiple email addresses from the CSV and log them in an output file. I know I need to broaden the search here: mail -eq 'john.smith@example.com' with…
0
votes
1 answer

How to iterate OU's with Get-ADUser -searchbase?

New to powershell, learning it on the fly. I run a report weekly that requires me to get a list of names from my employer, specifically the first half of the userprincipalname attribute, check each associated account in AD, get account details, and…
0
votes
2 answers

Get-AdUser Lookup for each user in csv list with LDAPFilter anr match

I'm querying AD for user details using a list of usernames derived from a different list meaning that not all usernames match the SamAccountName exactly e.g. might have a number or letter dropped from the end. I can get the exact match lookup to…
Ursa201
  • 3
  • 1
0
votes
1 answer

How can I output Active Directory users with date yyyy-mm-dd and OU path?

How could I write a PowerShell script that will export all AD users by USER > LAST LOGIN DATE > PASSWORD CHANGE DATE > ROOT OU > SUB OU > SUB OU with all data separated by cells in a CSV file? It would be nice to have the everything separated by…
0
votes
1 answer

Powershell Active Directory Account expiry email notification to manager

I have this PowerShell script that sends out emails to managers if the user's account is expiring within a certain amount of days, however, managers get a separate email for every user. Is there a way to send only one email with the list of…
Sam
  • 115
  • 2
  • 9
0
votes
0 answers

attempting to Get-Aduser but am wanting to get users only if there email match's with the primary SMTP address in there attributes

So I am in the process of learning PowerShell in the hopes of cleaning up active directory and was looking for a little help, My issue is that multiple users may share multiple proxy addresses but no two users will share there primary SMTP…
Alasdair
  • 1
  • 2
0
votes
2 answers

Removing User from a specific group in a specific OU

Hello guys I have this function Invoke-AdDesktopGGroup { [CmdletBinding(SupportsShouldProcess)] param($ADGroup) #$OUPath = "OU=SCPA,DC=souche,DC=ban" $user = Get-ADUser -SearchBase "OU=SCPA,DC=soucy,DC=lan" -Filter * -Properties MemberOf $user…
0
votes
2 answers

Export the AD Group Membership of a list of users from a CSV Powershell

I am trying to get a CSV output of all the users in the 'VPN Users' group that are also in the 'Domain Users' group. I'd like it to give their name and then their group membership. Each member should only be in the VPN group. I am looking to…
0
votes
2 answers

send email if extensionAttribute equals

I'm using two separate powershell scripts. The first one manually defines a date for the specified user's extensionAttribute15. The second one we intend to invoke via schedule to send an email 14 days from the extensionAttribute15 date but I'm…
nominus
  • 11
  • 5
0
votes
1 answer

Why are variables not working with Get-Aduser in powershell?

Looking for a little explanation as to why this isn't working and what I might be doing wrong. Any Help would be great! Expected Results : BSMITH Get-Aduser -filter {(givenname -eq "Bob") -and (surname -eq "Smith"))} | select-object…