Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

DarkOne72 (TechnicalUser) (OP)
10 Nov 11 18:27
I am writing a script to pull all the users who has a homedirectory on a certain server using a wild card.  It runs and no errors but it exports nothing and doesn't run long.
Any assistance would be appreciated:

CODE

$csvfile = "C:\Scripts\Home-Dir-Lookup.csv"

Get-QADUser -SizeLimit 0 -SearchRoot "ou=Ccntr-J,OU=Region Coastal,OU=Central Division,DC=home,DC=com,DC=com" -HomeDirectory *'
-ObjectAttributes @{homeDirectory='\\fla*'} -IncludeAllProperties |'
Select-Object LogonName,HomeDirectory |
Export-Csv $csvfile
texasit (MIS)
11 Nov 11 11:10
I'm not well versed at powershell but looking at your syntax it looks like you made a possible typo.It should be DC=home , dc=com  not DC=home, dc=com , dc=com.There could be something else but I caught that possible error while reading your script.   
DarkOne72 (TechnicalUser) (OP)
11 Nov 11 13:14
I have removed the second dc=com and receive
    + CategoryInfo          : NotSpecified: (:) [Get-QADUser], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Quest.ActiveRoles.ArsPowerShellSnapIn.Powershell.Cmdlets.GetUserCmdlet
1RedOne (Programmer)
14 Dec 11 9:39
First I would try running that command in segments in my console window, to see if you get any output.  

Break it down:

Get-QADUser -SizeLimit 0 -SearchRoot "ou=Ccntr-J,OU=Region Coastal,OU=Central Division,DC=home,DC=com,DC=com"

If you don't get all of the users in the Cost-Center-J OU here, Stop and fix the errors.  I think your formatting looks strange on the OU name.  Try changing the DC=Home to OU=Home.  You only use DC= for your the name of the domain.

Furthermore, if you're having trouble on the formatting of your Distinguished Names for your OU's, try this, replacing the text in -like "Your_OU_name_Here" with the OU you want.

get-qadobject -Type 'organizationalUnit' | ? {$_.Name -like "Your_OU_Name_Here*"}

You can copy the output from this to get the correct formatting of your OU's Distinguished Name.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close