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
Solved

Trimming info in a string

Posted on 2010-11-23
4
1,129 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 39

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
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 …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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