Solved

Trimming info in a string

Posted on 2010-11-23
4
1,128 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
  • 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 38

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

Join & Write a Comment

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now