Get-ADUser Script Runs but issues error command before returning all results

Greetings;
I am running Windows Server 2008-R2 and try to execute a PowerShell command as follows:
I am trying to locate user objects that have been inactive since September 1 and do not have any Exchange mailboxes. The query does run and I do get a number of records, however, the error is issued, as shown above.
can you please shed some light as to why I am getting this error message? I do appreciate your time.
Behrooz

I see this thread isn't answered yet, so I'm taking another shot at it.  I am positive my script is going to give you the results you are looking for. I have reproduced this in my lab.
What I did:
- I created a set of users in an OU in my domain.
- I populated the 'employeeType' property on a handful of them
- I created mailboxes fora subset of those users on my Exchange server
- I did NOT log in with any of these accounts, but that is the easy part.
Run this query and you will get a returned set of accounts that:
- Have not logged on since 9/1/2013
- Do NOT have a mailbox (this is query-able through Get-ADUser because the HomeMDB property is only populated when you have a mailbox.  Using the Exchange tools is not necessary)
- Accounts that do NOT have any anything in their 'employeeType' property.
Get-AdUser -filter * -properties * |
Where-Object {$_.HomeMDB -eq $NULL -AND
$_.employeeType -eq $NULL -AND
$_.lastlogondate -ge "9/01/2013"} |
Select displayname,distinguishedname,samaccountname,employeetype |
Export-Csv "employeetype.csv" -notypeinformation
** This result is going to find people with NO employeeType.  If that is the opposite of what you're looking for, change that like from -eq (equal) to -ne (not equal) or you can use -like and -notlike.  Both give the same results.
Your results will export to a CSV and will not print to the screen.  Again, with the way this is written, the employeetype column will be empty.
If you want to copy and paste this script, please paste it into the ISE and push play.  If you save it as a .ps1, you'll have to ensure you have the appropriate executionpolicy set (Open PS as an admin, run 'set-executionpolicy unrestricted')
If you chose to run it in a PS window as is, please ensure this whole syntax is all on one line.
Okay! Come back and tell me you were successful and mark me as the answer!! :)
Chris Ream

Similar Messages

  • I created a script to add logos to photos at a club and now when I run the script, the script runs but does not actually place anything on the photo itself.  What's going on?

    I created a script to add logos to photos at a club and now when I run the script, the script runs but does not actually place anything on the photo itself.  What's going on?

    He meant post it here, of course, Louie!  How on Earth would you post it "on Photoshop" ? 
    Thank you for the belly laugh. 

  • Since purchasing the Note 3 in October i have had nothing but issues. I went through all the steps and eventually I was sent a different phone, which was working for the most part until the recent upgrade. Now I am back to the old issues, no service, it a

    Since purchasing the Note 3 in October i have had nothing but issues. I went through all the steps and eventually I was sent a different phone, which was working for the most part until the recent upgrade. Now I am back to the old issues, no service, it actually says not moblie network available, when everyone else in my family has coverage and are on my plan with iphones. I am missing text messages and dropping calls left and right. This is unacceptable for the cost of this phone and my service. I have did a hard reset etc. What else can I do??

    Use the trackpad to scroll, thats what it was designed for. The scroll bars automatically disappear when not being used and will appear if you scroll up or down using the trackpad.
    This is a user-to-user forum and most people will post on here if they have problems. You very rarely get people posting to say there update went smooth. The fact is the vast majority of Mountain Lion users will not be experiencing any major problems with the OS, or maybe with apps which are not compatible, but thats hardly Apple's fault if developers don't update their apps.

  • Running but Dialog Queue info unavailable, J2EE: All processes running

    Dear SAP,
    I have start my SAP Solution Manager system. I can login.
    But the process disp+work.exe is in warning (yellow).
    I do have this warning :
    Running but Dialog Queue info unavailable, J2EE: All processes running
    Content of my dev_disp file :
    ================================================================================================
    Thu Sep 09 12:36:13 2010
    ***LOG Q0I=> NiIRead: recv (10054: WSAECONNRESET: Connection reset by peer) [nixxi.cpp 4436]
    ERROR => NiIRead: SiRecv failed for hdl 7 / sock 1308
        (SI_ECONN_BROKEN/10054; I4; ST; 192.168.110.71:53609) [nixxi.cpp    4436]
    Network error of client T27, NiBufReceive (-6: NIECONN_BROKEN), dp_tm_status=3
    Client address of T27 is 192.168.110.71(neo-l011.lia.local)
    ***LOG Q04=> DpRTmPrep, NiBufReceive (28 BUEHLER 27 lia-l011 ) [dpxxdisp.c   12238]
    RM-T27, U28, 100     BUEHLER , lia-l011, 11:55:32, M1, W1, DSWP, 3/1
    Thu Sep 09 14:07:57 2010
    ***LOG Q0I=> NiIRead: recv (10054: WSAECONNRESET: Connection reset by peer) [nixxi.cpp 4436]
    ERROR => NiIRead: SiRecv failed for hdl 7 / sock 1308
        (SI_ECONN_BROKEN/10054; I4; ST; 192.168.110.71:55886) [nixxi.cpp    4436]
    Network error of client T31, NiBufReceive (-6: NIECONN_BROKEN), dp_tm_status=3
    Client address of T31 is 192.168.110.71(neo-l011.lia.local)
    ***LOG Q04=> DpRTmPrep, NiBufReceive (1967 31 lia-l011 ) [dpxxdisp.c   12238]
    RM-T31, U1967, 000             , lia-l011, 14:07:54, M0, W0, SESS, 2/0
    Thu Sep 09 16:47:41 2010
    DpHdlDeadWp: restart wp (pid=9220) automatically
    ================================================================================================
    Thanks
    Best regards
    NetAdmin

    Dear SAP,
    It was a kernel problem.
    Best regards

  • My toolbar is missing and there is a button where it used to be that says "Please re-install the Toolbar" but when I click on it nothing happens? Also when I start Firefox I get a script running error how do I solve these issues?

    My toolbar is missing and there is a button at the top left that asks me to "Please re-install the Toolbar" but when I click on it nothing happens???
    Then when I start Mozilla I get a long delay before it launches and a script running error "A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
    Script: chrome://tavgp/content/libs/include.js:595"
    How do I solve these issues???

    No idea - and you provide no clues
    what version of iPHoto do you have? Of the OS? is the iPhoto icon you are speaking of in the Dock?
    re-read your post and try to provide information using standard Mac terms since we can not see you or your computer and only have your worrds to let us try to help you
    Somehow my "IPhoto" icon now says "Preview".  When I click on "Preview" nothing opens up except the bar says Preview.  When I click on the Preview on the bar, a box opens up with different items, except when I click on any of them, there is nothing there.  The only thing that work is the "quit preview".  However, it is still there where my IPhoto icon should be.  I can't get into my IPhoto.  How do I get rid of this "Preview" and how did it end up taking over the IPhoto icon???
    If you go to your Applications folder and double click on iPhoto what happen?
    LN

  • Firefox will not open, getting message "Already running, but not responding", also can't use TaskManager to close it.

    Have FF4, downgraded to FF3.6.17. Still not working.
    When I close out of FF, it still is in the processes tab of my Task Manager. And it won't let me do the "End Process" technique.
    End up having to restart computer... Pain in butt.
    Also even though I uninstalled Firefox 3.6.17, I still have these files which I can't delete.
    [IMG]http://i52.tinypic.com/727ubb.jpg[/IMG]

    Sounds like Firefox is "hanging at exit". That problem is frequently caused by an Extension or a Plugin. Read all of the following articles.<br /><br />
    NOTE: Establish a habit of exiting/closing Firefox with Firefox button > Exit or File > Exit to allow an orderly shutdown of Firefox and closing of all of the files that Firefox has open.
    #Stop the Firefox process:
    #*[http://kb.mozillazine.org/Kill_application Mozillazine - Kill application]
    #*Windows 7 users click [http://www.techrepublic.com/blog/window-on-windows/reap-the-benefits-of-windows-7s-task-manager/2576 here]
    #*Mac users: http://techheavy.com/2011/02/the-mac-task-manager/
    #Why Firefox may hang:
    #*[http://support.mozilla.com/en-US/kb/Firefox+hangs Firefox hangs] (see Hang at exit)
    #*[http://kb.mozillazine.org/Firefox_hangs Firefox hangs (Mozillazine)] (see Hang at exit and Closing Firefox properly)
    #*[https://support.mozilla.com/en-US/kb/Firefox+is+already+running+but+is+not+responding Firefox is already running but is not responding]
    #Use Firefox Safe Mode to find a problem with an Extension or Plugin:
    #*Don't check anything when entering Safe Mode, just continue
    #*If the problem does not occur in Safe Mode it is probably an Extension or Plugin causing the problem
    #*See:
    #**[[Safe Mode]] and [http://kb.mozillazine.org/Safe_Mode Safe Mode (Mozillazine)]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    #**[http://support.mozilla.com/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    #**[http://support.mozilla.com/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • Every time I try to load firefox, WindowsXP says firefox is already running but not responding and before it can load another I have to shut down the one running and reboot my computer.

    My problems started when I downloaded Ilivid downloader, after I loaded the program and watched the short video the program started messing up my computer. It spread itself all over my hard drive, changed my homepage, my search engine, locked me out of being able to change certain settings, made some of its files undeleteable and since then my firefox will not load. I removed my version of firefox and reinstalled it several times. I still got the same response. I went into the registry and deleted all references to Mozilla and Firefox and reinstalled it again, same response. I spent days trying to delete all references to ilivid downloader and every file I could find that made any reference to ilivid. I hope you can help me with my problem. I like using firefox and would like to start using it again. Thanks

    See
    * [[Firefox is already running but is not responding]]
    Try closing any running instances of ''firefox.exe'' (and plugincontainer.exe) using something such as Task Manager. That should allow you to then restart Firefox.
    As for iLivid. Possibly it also has associated apps or extensions with names not including the word iLivid. Looking at their own FAQs there are instructions to remove iLivid using the Windows Control panel, and mention of other bundled software that you may wish to remove. It seems it is more of a nuisacne rahter than out and out malware.
    * see http://www.ilivid.com/faq.htm (page scrolls for more info) but includes:
    How do I uninstall the software?
    The software can be removed in a simple was like any other software:
    Go to the Windows Start menu and then to Control Panel > Add/Remove ("Programs & Features" in Vista & Windows 7) and click "Remove" next to the software name (e.g iLivid Download manager / Windows iLivid Toolbar ).
    During the installation bundle software are offered, each can easily be removed following those instructions: Uninstall Yontoo Addon , Uninstall Search Toolbar (powered by Bing) or Uninstall Babylon.

  • Using Pagination, but Defaulting initial page to display all results

    Ok, I've inherited a JSF application that uses pagination to display results in a table. There's an enhancement request to initially display all the results of a table yet allow end users to "go into pagination mode." I've looked all over the web and played around with the code. Currently, I'm setting paginationbutton to true, but paginationcontrols to false. This remove the pagination navigation buttons, and initially displays all the results. Users can even go from displaying all results into pagination mode. However, the navigation is lost since paginationcontrols is set to false.
    Anybody know of a way to achieve what I'm looking for?
    Thanks,
    James

    Hi,
    When you execute any query on web, it actually uses a standard template which is present i.e. 0Analysis_Pattern and shows the report accordingly. Hence, your output will be based on the settings done in this template.
    So, I guess, you need to modify the number of rows to be visible at a time in the standard template.
    Hope this helps ..!
    -Pradnya

  • Script runs, but doesn't produce unless user logged in

    Here's a weird one, and I'm not sure which forum is proper for this. But since it deals with a powershell script, I gotta start somewhere.
    I've a powershell script called sendmail.ps1 which I have configured to create and send an email to me when run. Works flawlessly. So I've set it up in task manager to run the script whenever a Windows backup fails. Works great, provided the administrator
    is actually logged on to the server. I've set it up in task manager to run with the Administrator login, highest privileges, and hidden. Again, works great when the administrator is actually logged on to the server. (Server 2012R2). However, if the administrator
    is not logged on it appears that no email is sent. The task still shows "completed successfully" in task manager, yet no email is received - therefore I  assume it's not sent. I can find no errors in the event viewer (is there a specific container
    in event viewer I need to check for this?) What do I need to do so the sendmail.ps1 script will actually send an email when the administrator is not logged on to the server?
    Here's some things I've tried in various combinations.
     - Task is configured/optimized for Server 2012R2 under the general tab.
     - Have tried it both hidden and not hidden
     - Hive tried it with the administrator account and the system account. Both work only when administrator is logged on.

    Thanks for the feedback mjolinor. I've not downloaded the analyzer, because from reading the description for it, it appears I'd have to be logged on for it to be useful. Remember, the task words flawlessly if logged on, but not if logged off. So far, the
    only thing I can get is output to a log file of:
    Exception calling "Send" with "1" argument(s): "Failure sending mail."
    At C:\Client Apps\Powershell Scripts\sendmail.ps1:11 char:1
    + $SMTPClient.Send($SMTPMessage)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : SmtpException
    From looking at it, the "error" is being generated by the very parameter that creates the log file - though the log file is successfully created. Weird.
    With the "Start-Transcript" added, where does it capture the output to if the task runs while not logged on to the server computer? Or do I just add the path\filename as a parameter after Start-Transcript ?
    This is truly perplexing to me, as it doesn't make any sense that it runs perfectly when the administrator is logged onto the server. But when not logged on and the task runs that executes the pwershell script, the task itself will show as executed successfully,
    and I can't find any errors in the basic logs of the event viewer. Perhaps it's one of the other containers in event viewer where something is logged, but there's so many of them, I've not a clue which one. Right now, I'm working through each one at a time
    to see if anything jumps out at me.
    If you're interested, here's some additional background to explain why it has to run with the administrator logged off. This server runs a 3rd party practice management software program for a dental office. The program is poorly constructed, as it has "memory
    leaks". This server has 32Gb of memory, and because of the memory leaks, it will run out of useable available memory about every 36-48 hours. So for this reason I've got a task set up to just reboot the server daily at 6am, one hour prior to employees
    arriving for business. This ensures they start the day "fresh" and the server won't lock up on them during business hours. The business owner absolutely loves this program, and even after I explained the issue to him as best I could in a way I hope
    he could understand, he's not changing software vendors. I've already notified the developer of this problem, and apparently they've been aware of the memory leak for years, and their solution is "reboot daily". All I can say about that is, they're
    lucky they don't work for me.
    So it's very likely that with daily reboots, this server could go for weeks without anyone logging on to it. Therefore, the powershell script needs to run weather the user is logged on or not. Else, backups could not occur for weeks and no one would ever
    know it - until it's to late of course.

  • Perl, my old scripts run but a I can't run new scripts

    I'm getting back into Perl and I have old practices files which will run fine. But when I write a new script nothing happens. Currently using 10.4.5, BBEdit 6.1 Lite. All my scripts have the following first line: #!/usr/bin/perl
    Old scripts work, if I type a new one and run it nothing happens except I get a new command line prompt.
    On the other hand if I remove the #!/usr/bin/perl line and go to the command line and type: perl programname. Programname will run!?!!?
    I still have to dig into the man pages on perlrun. Does anyone have a clue?
    Thanks, Dennis

    thanks for all the information. I really appreciate the replies.
    all of my experience is based on the O'Reilly book I mentioned above. I've tried to respond to all the comments but the order is not exact.
    chmod 755 uses an octal argument to change the permissions on the file.
    In particular the file becomes executable.
    1. which perl returned /usr/bin/perl which explains why the old perl programs run. Perl is where it's supposed to be.
    2. I haven't done anything to my system as far as a rehash goes(what is that anyway?)
    3. the wc -l command returned 0 hw2, meaning zero lines, bingo!! this must be it, don't you think?
    4. So why will BBEdit let me write, save, reopen files with content and UNIX sees the file as empty.
    5. when these programs are run, nothing happens I just get a new prompt.
    BTW the program, called hw2, in question reads:
    #!/usr/bin/perl
    print "hello, world. \n";
    get this: when I do cat hw2 I get a listing without the #!/usr/bin/perl at the top ie I see one line instead of two even though wc -l reports zero lines, what's up with that???
    I think that's everything for now. I'm going to look for another texteditor
    ps does it matter what the line end character is? I can choose Mac or UNIX.

  • Web inteligence, running query issue-error

    desperate-please help
    I can log into Business Objects (12.1.0.), access the Universe, but when I try to run the Query an ERROR will pop-up
    : "(NCR)(ODBC Teradata Driver)Not enough info to log on ( WIS10901)"
    I have the access and can't figure it out
    I appreciate the help

    The message means that the oracle network layer tried to resolve the connection parameters given and failed.
    When you use infoview in the browser, the problem is on the physical server where the connection server runs.
    Ask the persons responsible to check the oracle client installation there and try to get a connection to that oracle database.
    It can be anywhere in the oracle names administration. The most common error is an incomplete tnsnames.ora file.
    Good luck,
    Marianne

  • Executable created in LabVIEW 7.1 containing Call Library Function Node runs but creates error when Call Library Function Node is executed

    I have created a simplee application that controls a piece of equipment with all control via a supplied dll.  Hence, there are a number of Call Library Function Nodes within the code and a modicum of other LabVIEW code.  Everything works fine as a LabVIEW application, but when converted to an executable, although the application runs and functions, as soon as any Call Library Function Node is executed, calling from the dll, I get the C++ debug error in the attachment.
    Is this something that I can solve from within LabVIEW, or is the problem likely buried in the dll?
    Damian
    Attachments:
    CLFN error.JPG ‏22 KB

    Hi Wise,
    Try building an executable from a very simple VI that makes one call to the dll. Have you also try using the Call Library Function node on other simple dlls that you know will work?
    Regards,
    Stanley Hu
    National Instruments
    Applications Engineering
    http://www.ni.com/support

  • An update tries to run, but an error message stating "The update could not be installed. Please make sure there are no other copies of Firefox running on your computer, and then restart Firefox to try again." I can't open Firefox

    I click on Firefox and it says that Firefox is installing your updates and will start in a few minutes. Then I get "The update could not be installed. Please make sure there are no other copies of Firefox running on your computer, and then restart Firefox to try again." this cycle never ends. Do I need to deinstall Firefox and re-install? If I do that, do i lose all of my bookmarks, etc?

    See http://kb.mozillazine.org/Software_Update (Software Update not working properly)
    Remove the files in the updates and updates\0 folder:
    *C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Mozilla\Firefox\Mozilla Firefox\updates
    *(%USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Mozilla Firefox\updates)
    *C:\Program Files\Mozilla Firefox\updates
    *Do a clean reinstall and download a fresh Firefox copy from http://www.mozilla.com/firefox/all.html and save the file to the desktop.
    *Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer. Do not remove personal data when uninstalling.
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    You can skip the step to create a new profile, that is not necessary for this issue.
    See http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • BDC-Not getting inserted  when run in 'Display errors- (E)' mode

    Hi,
    I am doing a BDC for FS00 transaction through Call transaction method. The data is getting inserted into the table when i run the BDC program screen by screen through 'Display all screens - (A)' mode and is not getting inserted into the table when i run the BDC program through 'Display errors- (E)' mode.
    What could be the reason for it?

    If you have defined a non-existing screen or field, and error will rise and the transaction will be stoped....
    When your working on 'A' mode, you need to perform an extra "Enter" button press to get rid of that problem....So you better check your Batch catalog and add some "Enter's" when need it -;)
    Greetings,
    Blag.

  • IChat AV 4.0  issues, Error 8 - read through all the threads...Help needed

    SO searched all the threads on Error 8 - in the past my friends and I have always either found the answer or updated the SW and video chat has worked.
    I am out in California using T-Mobile account at StarBucks (and other free WIFI locations) I can connect and video Chat with my home with iMac using iChat last (version) update in Tiger. Apple Extreme wireless. I have also been able to connect with Buddy 2 when at home.
    Problem ( 1) I cannot connect buddy 1 (with the linksys) directly from my connection.
    (Interesting side note: Home connects with Buddy 1, then in that connection I was added to the Video Chat and this worked.)
    Note: (2) I cannot connect to Buddy 2 (also with a linksys) directly from my connection.
    Note: (3) Buddy 1 can connect to Buddy 2
    Note: (4) Buddy 2 travels to Buddy (3) home (also with a linksys) and they connect and add Buddy 1
    Problem (5) they try to add me (at T-mobile StarBucks) and cannot connect.
    We have systematically tried:
    1) QT set to 1.5 - iChat bandwidth set to None
    2) tried different ports ( 443) in iChat Prefs,
    3) Opened ports on the linksys routers
    4) Checked Sys prefs firewall (allow all incoming connections checked)
    What should we be looking for?

    Do they have Linksys devices that have a Security Page ?
    If so have they set it to "Respond to Anonymous Pings" ? as iChat sends a Ping.
    I would also go for the UPnP option
    10:09 PM Monday; February 4, 2008

Maybe you are looking for

  • Performance issues with version enable partitioned tables?

    Hi all, Are there any known performance issues with version enable partitioned tables? I’ve been doing some performance testes with a large version enable partitioned table and it seems that OCB optimiser is choosing very expensive plans during merge

  • HT204053 Can you merge multiple Apple IDs?

    I have somehow collected 3 IDs over the years and want to merge them so I don't keep having to log out and resign in every time I need to update my apps on my iPhone and iPad. Any thoughts? Thanks!

  • Pricing for VM running WS 2012 E R2 primarily as domain controller for ~5 clients

    Hi I am starting a small medical clinic, with only about 6 client PCs.  However, I  would like a domain network structure for security purposes moving forward rather than a workgroup. I'm looking at either purchasing a modest server (ie HP Proliant m

  • Exported PDF page size too large on screen

    Fairly new to InDesign ( and loving it ) I am creating a document using InDesign v5. which has a page size of 8.5 x 11 in and two pages to a spread. When I export a page or a spread to PDF the page or spread will print fine BUT when I view this PDF o

  • Short Dump in table maintenance events

    Dear Experts, I am getting a short dump when i am trying to maintain my Z table. the error is "The statement "MOVE src TO dst" requires that the operands "dst" and "src" are convertible. Since this statement is in a Unicode program, the special conve