why defaultnamingcontext not working ?

## determine the LDAP search path ##
$obj=[ADSI]"LDAP://ROOTDSE"
$mysearch = $obj.defaultNamingContext

get-qaduser -searchroot $mysearch ==> not working

but

get-qaduser -searchroot 'DC=etc,DC=microsoft,DC=com' ==> working

Do i need to list it out openly ?


0
IT
6/25/2010 4:43:21 AM
windows.powershell 690 articles. 0 followers. Follow

1 Replies
1787 Views

Similar Articles

[PageSpeed] 9

$mysearch is a collection:

PS > $mysearch.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     False    PropertyValueCollection                  System.Collections.CollectionBase


All you need is the value:

$mysearch.Value


Get-QADUser -SearchRoot $mysearch.Value ==> working



Running Get-QADuser without specifying -searchroot should start searching 
at the domain defaultNamingContext. To get defaultNamingContext with QAD:

(Get-QADRootDSE).defaultNamingContextDN


This should work but again you don't need it:

get-qaduser -searchroot  (Get-QADRootDSE).defaultNamingContextDN



---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar: http://tinyurl.com/PSToolbar
Twitter: http://twitter.com/ShayLevy



IS> ## determine the LDAP search path ##
IS> $obj=[ADSI]"LDAP://ROOTDSE"
IS> $mysearch = $obj.defaultNamingContext
IS> get-qaduser -searchroot $mysearch ==> not working
IS> 
IS> but
IS> 
IS> get-qaduser -searchroot 'DC=etc,DC=microsoft,DC=com' ==> working
IS> 
IS> Do i need to list it out openly ?
IS> 


0
Shay
6/25/2010 8:44:59 AM
Reply:

Similar Artilces:

Formula not working
I am using this formula: =SUMPRODUCT(--(Participants!P5:P439="Y"),--(Participants!K5:K439="Grey")--(Participants!J5:J439="L")) to find the number or team members who have qualified (Y), for a (L) large grey shirt. By sorting the list several ways and using countif, I know the answer is 8, but the above formula is returning 53. I have tried change the order of things, but I still get the wrong answer. Can anyone help? No rush!! Thanks Could it be that you lost a comma between the last two parts of your formula? NeedHelpFast wrote: > > I am using ...

Unable to get a IF Function to work, Please Help
I need to take a total that is being pulled from another sheet to the sheet I am trying to get the if function to work. I am not sure if the IF function is what I really need to use. The following is an example of what I am trying to do: first work sheet shows the total 10.5 however, the factor for the totals that I need in the second work sheet has to be always at 8 ( how can I set the that second cell to pull from the 1st cell and make it to always total 8??? -- Thanks, Matt If I understand you correctly (and I'm not at all sure I do): put this in sheet2: =8 - Sheet1!A1 ...

How do you set a repeating task in Outlook that works every day
I have tried every way I can figure out and I can not get tasks to work for setting a task to repeat every day at the same time. Example: A task is set as a repeating task every day at 10AM it works for a day or two then resets some way and then will not work. I configured it numerous ways and I can't get it to work. Do you set the task complete every day? I've got a recurring task to wake up my wife every day and it regenerates every day as long as I set the task complete every day. "MontyRP" <MontyRP@discussions.microsoft.com> wrote in message news:9E699916-31...

A search for $ in a formula use to work now it does not work
Using Find $256 on a column or columns in Excel, that contains formulas used to work but now I am getting a message that says ...detected that your search contains formatting symbols. Any Ideas as to why it is not working now. Find/Replace won't find $256 if its 256 formatted to look like dollars. Use 256 instead. -- Gary''s Student "JuneJuly" wrote: > Using Find $256 on a column or columns in Excel, that contains formulas used > to work but now I am getting a message that says ...detected that your search > contains formatting symbols. Any Ideas as ...

RUS does not work
I have a fairly new Exchange 2003 member server running on W2K3. I have three DCs running W2K and all are GCs. All servers are on the same subnet. When I create new users and give them mailboxes, they never receive email addresses and never show up in the GAL. I have tried re-pointing the RUS to a different DC. I have tried updating/rebuilding the RUS. I have even deleted and re-created the RUS. The option to automatically update addreses based on recipient policy is selected. When I first installed Exchange, it stamped my 250+ users with the proper addresses, but now any new users I create c...

Copy paste in excel dont work properly
Hi all I am facing very very wired probelm related to cell of excel sheet. Maximum character limt of cell is 32767. I have some text of 32767 characters. Whe i try to copy paste that text into excel sheet from notepad it is copying pnly 31767 caracters and not ending 100 characters. And if then i try to append ending 1000 characters to string it is accepting those characters in that cell. But i don't know why at a time of copy pasting it is not woring . Can someone help me why this is happening. Any help will be truely appreciated as this is very very important for me. Thanks in ad...

cannot create temporary working file
I have a user in publisher 97 (yeah I know it is outdated, but if we upgrade then we will loose all of our files) who keeps on getting an error when trying to save that Publisher cannot create a temporary working file. I tried restarting, and shutting down the computer, and the same error keeps on coming back. I'm about to reinstall publisher, but was wondering if there is a simple solution. Thanks for any help. Yosef While waiting for decisions from his 6 university choices, Ed sees a message from Yosef <anonymous@discussions.microsoft.com>. On it is written: > I have a...

Paste Hyperlink result as working hyperlink
Hi! I have a column of over 700 filepaths. I have a column which turns those paths into hyperlinks: =hyperlink("http://tbuk/"$B3) These links work. I want a single column that doesn't refer to the filepath, so I am trying to replace the hyperlink formulae with the result as a hyperlink. When I copy and paste, it seems to paste the result, but the link doesn't work (though it still has the style of a link: blue underlined). Is there a way to avoid having to press F2, Enter for every one? On Thu, 21 Jan 2010 12:03:01 -0800, Bod <Bod@discussions.microsoft.com>...

Tooltips working in MFC app, but not from DLL
I have a class which is derived from CWnd. It creates a couple of buttons, which have tooltips. Tooltips is implemented by calling EnableToolTips() and by handling the generated messages: ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify) ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify) The code works fine. But, I have taken my code and placed it into a DLL. The DLL has one entry point. There I create my class, including the buttons. When my code is in a dll, tooltips no longer works. OnToolTipNotify never gets called. In stepping through the code, ...

Why is this not working?
why is this not working? it should add up the values of every 6th cell (H6 through to FB6), but if any cell is over the value of D6 then D6 's value is taken as the value for that particular cell in that particular instance. it seemed to be working, but if i enter a value of over D6 in H6 etc, the answer is worng. =SUMPRODUCT((MOD(COLUMN(H6:FB6),6)=2)*(H6:FB6<=D6)*H6:FB6)+D6*SUMPRODUCT((MOD(COLUMN(H6:FB6),6)=2)*(H6:FB6>D6)) cheers! steve The formula seems to work as you've described. Let's take a look at the following example where... D6 contains 100 H6 conta...

Lookup code working in RMS
Hi all, I m going to implement SO in Garments store.They are already using Look up code. Let me explain how they r. Here is the look up code example: 12122 0202 101 The first 5 digits represent item code, 2nd represent color code, 3 represent fabric code.How RMS can handle this look up code.can any1 explain me??We have Deparment & category in item maintenance form.I guess we have to make setups for COLOR & FABRIC . wat would u suggest? -- With Regards Junaid Idrees Associate Project Manager Enterprise Business Solutions 4th Floor mehdi towers,shahra-e-faisal karachi,Pakistan....

Hyperlink does not work with #
I have Outlook 2002, When I add a file as hyperlink that have the character '#', the hyperlink does not work, i.e.: <file://R:\Prod_Supt_Workbook\Production\Inwork\09_Inciden t_Data\2001-Plogs\2001-Plogs\Pl#0959 \SpecSit_PAYGDGCO_for_Cleanup_of_prod_Libraries.doc> If I change the "#" for its hexadecimal value "%23" the hyperlink works fine: <file://R:\Prod_Supt_Workbook\Production\Inwork\09_Inciden t_Data\2001-Plogs\2001-Plogs\Pl#0959 \SpecSit_PAYGDGCO_for_Cleanup_of_prod_Libraries.doc> Do you know if there is a patch for this? Thanks There is no pa...

Microsoft Word stopped working
Office 2002 Try to open or create a document and Word freezes. Upon closing Word, error = Microsoft Word has stopped working. error asks to look for salutions on line withe no results. operating systam is Windows 7 home See http://word.mvps.org/FAQs/AppErrors/ProblemsStartingWord.htm -- Terry Farrell - MSWord MVP "firedog22" <firedog22@discussions.microsoft.com> wrote in message news:8EB101DC-CDD2-4568-AAA7-EFFB87C27433@microsoft.com... > Office 2002 > Try to open or create a document and Word freezes. > Upon closing Word, error = Microsoft Word ...

Merge Imagelists Not working...
I have some custom buttons. Each button varies only by the text that is written on them. I have an image list of just the button states, buttons.bmp, and another with all of the text, text.bmp. What I want to do is programmatically merge the button states with the text to create a new imagelist that I can attach to my button. What I get is a blank button. I'm using ATL, and after a look over the source its not much different. I've read through the explanations on MSDN, but I'm having trouble. Is there something I'm doing wrong below? Notice that my images do not have masks....

Accesskey not working
Hi, Is there anybody out there that knows how to solve the issue with accesskeys? I have a problem with not being able to get them to work on my custom buttons. Any help is mostly apprieciated. Regards, I have the same issue. I've configured the accesskey attribute in the ISV.config file for a custom toolbar button, and it does not work. What am i missing? "M" wrote: > Hi, > > Is there anybody out there that knows how to solve the issue with > accesskeys? I have a problem with not being able to get them to work on my > custom buttons. > Any help is m...

Outlook 2003: Getting News Reader to Work
Hi... I just got the standard Office 2003 Upgrade. In my previous version (2000), I could read news from Outlook. When I try to configure it, using the info in the help screen, it doesn't work. Clicking on News in the right pane produces a plus sign, but as soon as I cross over to the left pane and try to move it towards Go (as directed), the plus sign turns into an X. And nothing happens. Of course, it could be worse. At least I can still use Outlook Express (as I am now doing), but it would be nice if my shiny new Outlook 2003 could do what I wish it could. Any suggestions. Thx John Ol...

Rear Speakers Not Working But Work in Audio Manager???
My speakers quick working. I have speakers plugged into Rear Speaker Out Jack and Headphones plugged into the Main Line Out Jack (manual says good for headphones) and a Mic plugged into the Mic Jack. This has been working fine up until a few days ago but now I can only hear from my headphones and nothing from my speakers. I checked in the Realtek HD Audioi Manager and everything seems to be set right and when I run the Speaker Configuration Test, the rear speakers work fine and I can also hear from the heatpones. Any help will be appreciated. Thank you. Win Vista, onboard...

AutoAcceptAgend does not work
Hi, I have a couple of Resourcemailboxes that I migrated (move Mailbox) from our old Exchange 5.5. I try to use the AutoAcceptAgent Sink but I get the following error when I send the first Appointment: Any Ideas ? Thanks, Volker Ausnahme beim Verarbeiten von Objekt "file://./backofficestorage/XXXXXX.de/MBX/EFGGruppenraum7/NON_IPM_SUBTREE/MTS-OUT/hhh.EML/hhh.EML". Dieses Objekt wird nicht verarbeitet. Ausnahmeinformationen: System.Runtime.InteropServices.COMException (0x80040E19): Ein Objekt oder Daten, die den Angaben für Namen, Bereich oder Auswahlkriterium entsprechen...

Dynamic Range Not Working
I created a named range called HarvestData. In the refers to box I typed the following: =OFFSET(Harvest!$A$2,0,0,COUNTA(Harvest!$A:$A),COUNTA(Harvest!$1:$1)) I hit ok. If I go back into the "Define Name" dialog box and select the name "Harvest" and have it point to the actual range in the worksheet, it highlights cells A2:B20. The problem is, there are data in columns A to N. Why is it not recognizing the rest of the columns? I discovered this problem because I'm referencing column h in a VLOOKUP and it is not returning data that I know is there. What am I doing...

why defaultnamingcontext not working ?
## determine the LDAP search path ## $obj=[ADSI]"LDAP://ROOTDSE" $mysearch = $obj.defaultNamingContext get-qaduser -searchroot $mysearch ==> not working but get-qaduser -searchroot 'DC=etc,DC=microsoft,DC=com' ==> working Do i need to list it out openly ? $mysearch is a collection: PS > $mysearch.GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True False PropertyValueCollection System.Collections.CollectionBase All...

OOO not working
I've encountered a strange problem with one client running Outlook 2000/WindowsXP (both fully patched) accessing an Exchange 2003 server. The issue is ... for this one user, Out of Office messages do not get sent when he sets the OOO Assistant to "not in the office". Some facts to consider; User had the issue previously when on Exchange 2000 (recently migrated to new server). No one else has the problem, OOO works. Tried turning on OOO from within OWA and that doesn't work either. Yes, connected to the Exchange Server. Yes, Exchange extensions are installed. I've seen s...

Money 2003 Help not working
My "Help" in Money 2003 does not work at all! It keeps saying unable to load to topic. Anyone know how to fix this? In microsoft.public.money, alex wrote: >My "Help" in Money 2003 does not work at all! It keeps >saying unable to load to topic. Anyone know how to fix >this? In Internet Explorer delete your browser temporary files with Tools->InternetOptions->DeleteFiles. Then open Money with Start->Run and entering "msmoney -s" without the quotes into the box. If that does not do it, try http://support.microsoft.com/default.aspx?sci...

Send to Onenote on Windows 7, driver won't work?
I downloaded the driver from David Rasmussen, but every time I open OneNote after printing to XPS I get the message "Unhandled exception has occured in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately. Object reference not set to an instance of an object." If I click continue it still doesn't work. This was one of my favorite features - PLEASE PLEASE PLEASE find me a way to use OneNote! I lived off of it last year. Rilli wrote: > I downloaded the d...

auto caps don't work
in outlookk 2003, even tho i have set tools, options, spelling to autocorrect the first word of a sentence. it doesn't do it. i have never had this problem before, but now i have a new laptop and can't get this feature to work. -- tom martin Are you using Word as your editor? If so, your settings are there. Otherwise, learn to type. http://www.broderbund.com/jump.jsp?itemID=4713&itemType=CATEGORY&path=1%2C2%2C4713&ysmchn=GGL&ysmcpn=Typing&ysmcrn=sr2br29go633go202pi10ai50&ysmtrm=sr2br29go633go202pi10ai50+mavis+beacon&ysmtac=PPC&ovtac=PPC&SR=s...

Hyperlinks to DB dont work now that DB is converted
We have converted all our Access 97 databases to Access 2000- not without a lot of issues. Most of them have now been researched and resolved, some re-coded, etc. We have one issue that we cannot resolve. We used to have hyperlinks on our Intra-net to several Access Databases. These were essentially "shortcuts" to the databases so that the general population could have easy access. Now that we did our Access conversion, the hyperlinks on our intranet do not work. Clicking on the link gives an option to open the file from its current location or download it to a local loc...