Solved

Trimming info in a string

Posted on 2010-11-23
4
1,132 Views
Last Modified: 2012-06-21
I need to be able to chop the CN section of a user's Distinguished name so it leaves the DN of the folder that the user's account is located in. Any recommendations on how to parse this or easy methods to pull that? My brain's a little fried right now but this is blocking me from moving forward on this project.
0
Comment
Question by:Adam Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
KenMcF earned 250 total points
ID: 34201620
I think this is what you are looking for

get-qaduser USERNAME | select ParentContainerDN

or

(get-qaduser USERNAME)ParentContainerDN
0
 
LVL 41

Author Comment

by:Adam Brown
ID: 34201637
Fuf...Can't believe I didn't find that attribute. Been too long since I've messed with powershell. Thanks :D
0
 
LVL 11

Expert Comment

by:louisreeves
ID: 34201645
I am not sure of the scope of what you are doing. Are you wanting to chop many CNs? I would look at using the find and replace feature, of the top of my head. Maybe if I know more about the way you are working, and the goal of what the chopping is all about, I could help more.  
0
 
LVL 27

Expert Comment

by:KenMcF
ID: 34201659
No problem, glad it worked out
0

Featured Post

Are You Headed to Black Hat USA 2017?

Getting ready for Black Hat next week? Kick things off with the WatchGuard Badge Challenge and test your puzzle and cipher skills. Do you have what it takes to earn our limited edition Firebox Badge? Get started today - https://crimsonthorn.net

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Let's recap what we learned from yesterday's Skyport Systems webinar.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question