Questions tagged [get-aduser]
91 questions
0
votes
1 answer
Active Directory - How to retrieve information from the otherpager property array
A colleague put an information in the otherPager property of our active directory. I must retrieve this information.
Im am using this code
Import-Module ActiveDirectory
Get-ADUSER -Filter * -properties otherPager | Select-Object -Property Name,…

Philippe MERLE
- 3
- 2
0
votes
1 answer
Getting AD user MemberOf (group memberships) values using PowerShell
I’m attempting to get MemberOf values for an AD user object. However, I’m hitting some roadblocks wherein I am not able to get an absolute list of AD group memberships (MemberOf) for a given AD user.
I get most MemberOf AD Groups when I query…

Karthick Ganesan
- 375
- 4
- 11
0
votes
1 answer
Why does the Get-ADUser -Filter command not accept $_ as input?
I have been troubleshooting code today and I discovered that this code does not work. I am using a PowerShell pipeline to send an array of distinguished names to search Active Directory for users with a manager.
$managers | Get-ADUser -Filter…

qwe57boz8
- 33
- 5
0
votes
0 answers
Can't retrieve data from get-aduser using python powershell
I'm trying to store data from the active directory in a variable. When i run this code using python i get nothing:
import subprocess, sys
def run(cmd):
completed = subprocess.run(["powershell", "-Command", cmd], capture_output=True)
return…

Denzel
- 359
- 4
- 12
0
votes
2 answers
Retrieve Emails addresses in CSV file in Powershell via Get-ADGroup command
Currently I have a script that I am able to interrogate an OU (which I define in the script) which shows Username, Name of the user, AD Group Name and the Description of that AD group into a CSV file:
$ou = 'distinguishedName of my OU'
Get-ADGroup…

S.Mahmood
- 129
- 11
0
votes
0 answers
Get email addresses of users through powershell into CSV file
I have a PowerShell script (big thanks to Santiago Squarzon) that pulls off users who have been inactive for past 6 months.
Currently work fine and outputs:
1. Username
2. Name
3. DistinguishedName
4. LastLogon
This is part of the…

S.Mahmood
- 129
- 11
0
votes
1 answer
learning powershell, and having some issues with GetADUser with -Filter
So I am having some issues with the below script. The weird part is, when I run the apparently offending part separately by itself, it works fine. It's only when it tries to run in the add_Click function that it throws an error message.
[void]…

Forrest Vasilinda
- 11
- 3
0
votes
1 answer
Powershell Query does not calculate correct Date
HelloThere,
we get AD-Users from an import script that runs daily and if a user was found in a csv we write the current date in the extensionattribute1 in format "dd-MM-yyyy".
Now we want to calculate if a AD user has a different date in the…

Bla Bla
- 13
- 3
0
votes
2 answers
Get-ADUser , merge two filter
I am trying to get the inactive users from AD with the following code:
# set the date (the number of days)
$NumberOfDays = 60
# set the timeframe ranging for the amount of days entered
$TimeRange = (Get-Date).Adddays(-($NumberOfDay))
# checks for…

Elham Khan
- 71
- 8
0
votes
1 answer
Filter AD Users if one Property is Filled and one is empty
Im trying to get a list of all ADUsers that have there mail property filled and where the proxyAddresses property is empty.
First i got the ADUsers and allready tried to filter to only get thoose whith filled mail property.
$ADUser = get-adUser …

Trippin
- 73
- 1
- 8
0
votes
0 answers
PowerShell: Combine AD-GetComputer & AD-GetUser
I am searching for an example of how to combine Get-ADComputer with AD-GetUser.
Get-ADComputer -Filter 'Name -like "Nany-*"' -Properties CN, IPv4Address | Select CN,
IPv4Address|
Export-CSV "C:\Computers&Users.csv"
This creates the information I'm…

Clay
- 1
- 1
0
votes
0 answers
POWERSHELL - Display Users AD Group That Starts With a Specific Character
This is my script it can display all the AD group that is assigned to a user account. I just don't know the syntax on how to do a wildcard search.
Write-Host "'Get AD Groups"
$userName = Read-Host -Prompt "Please enter the LDAP ID"
$ADUser =…

NOBODY519
- 1
- 2
0
votes
1 answer
PowerShell script to display users AD groups
I apologise if the question has already been asked.
I am slightly new to PowerShell and I was wondering if you guys could help with creating a PS script to display all AD groups of a specific user e.g. being prompted to enter a username then after…

S.Mahmood
- 129
- 11
0
votes
2 answers
display memberof with separate parts
I created a powershell script below about Get-ADUser MemberOf to display VPN Security Groups and the Other Security Groups groups and I would like to eliminate the redundancy on this
Code below first part where it only shows the VPN Security Group…

kila
- 3
- 2
0
votes
0 answers
Get-ADUser manager email field blank
I wrote this code which works except for when I tried to add this: -and '$($user.'Manager Email' -notlike '')' to the end of the Get-ADUser Manager section which causes it to fail. What I would like to accomplish is to leave the Manager field blank…