Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with spaces in FQDN

Status
Not open for further replies.

mikethxxx

IS-IT--Management
May 7, 2009
1
CH
Hi Guys

I am new to the VB scripting environment, having some issues with the FQDN of one specific OU. What needs to be done if an OU has spaces in the name, this specific one is called Users & Workstations.
BTW, the reserved characters in OU names was not my idea! inherited, and I cannot change them.

Thanks
Mike
 
Enclose the name in quotes.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
chr(34) & "OU=This is my OU,OU=This is the parent,DC=domain,DC=com" & chr(34)

-Brandon Wilson
MCSE:Security00/03
MCSA:Messaging00
MCSA:Security03
A+

 
Why do you have to worry about space in the fqdn??? It is not considered as special characters that need to be escaped if they are literal.
 
its not a problem in the code engine/script host (WSH), its a matter of how ADSI reads distinguished names it is passed for actions (whether that be programmatic user additions, deletions, disabling, etc.)....Windows/Active Directory inherently requires anything with a space in the name to be enclosed in quotes. Any programs that don't require the quotes are simply appending chr(34) characters to the front and end of the DN string in the background before making a call. Since in VBS, calling something like "OU=Test OU,DC=domain,DC=com" and enclosing in quotes as written does not put quotes into the command string itself, it would be passed to AD and seen only as "OU=Test", which since that isnt a complete DN, the call would of course fail.
I believe however, that this is something that is primarily offensive to Microsoft domains, and does not necessarily apply to something like iPlanet (although it could very well)...

-Brandon Wilson
MCSE:Security00/03
MCSA:Messaging00
MCSA:Security03
A+

 
>ts not a problem in the code engine/script host (WSH), its a matter of how ADSI reads distinguished names it is passed for actions (whether that be programmatic user additions, deletions, disabling, etc.)....Windows/Active Directory inherently requires anything with a space in the name to be enclosed in quotes.
Don't need to give much thought on this, I can come to the conclusion: I don't think so.
 
Ok show me a query using vbscript/ADSI, or anything native that is outside of ldp that will work to define a distinguished name with spaces in it without quotes. I'll tell you now, it wont happen...basically, do it any way but with a GUI interface....bet youll need those quotes...
Active Direwctory is specifically what I have architected, implemented, and created automation tools for a large number of years....the case is always the same, you need quotes...

- Brandon Wilson
MCSE:Security00/03; MCSA:Security03
MCSA:Messaging00; MCP; A+
IT Pangaea (
 
If space is taken as separator, it is a matter concerning generic thing outside of the realm of active directory in that context.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top