I need a script to help me check all the AD Computers for a certain file.

What I'm looking for is a script that I can use to check all the AD computers in my domain for a file that was created by Malware. It would be great if the script could export the results as a csv and have a column for the computer name, IP address, and
if the file/path exists.
I'm new to Powershell and I've been trying to script it on my own but no luck so far. I would be extremely great-full for any help, or a point in the right direction.
I messed around with different commands:
I'm not sure if I should be using test-path or get-childitem with recursive and wildcards.
This is a sample of what I'm working with... I know it probably horrible but like I said I'm new.
$date = [DateTime]::Today.AddDays(-90)
$AllComps = get-adcomputer -filter {(Enabled -eq 'true') -and (lastlogondate -gt $date)} | select name
$Allcomps = $AllComps[100..125]
foreach ($ADcomputer in $AllComps)
function check-remotefile {
    PROCESS {
                $file = "\\$_\C$\Windows\notepad.exe"
                if (test-path $file)
                echo "$ADcomputer: .exe exists"

You fail to ask a question.  What is it you do not know or understand?
Start simple and learn how to best post code:
$date=[DateTime]::Today.AddDays(-90)
Get-adcomputer -filter 'Enabled -eq $true -and lastlogondate -gt $date' |
Where{test-path "\\$($_.Name)\C$\Windows\notepad.exe"} |
ForEach-Object{echo "$($_.Name): .exe exists"}
Learn the basics. The pipeline is you friend.
¯\_(ツ)_/¯

Similar Messages

  • My external speakers have stopped working. A circle with a line through it shows up when I try to adjust the volume.  I have been in system prefrences to check all the sound settings and everything is set properly.  What do I need to do to fix this. Help!

    My external speakers have stopped working. A circle with a line through it shows up when I try to adjust the volume.  I have been in system prefrences to check all the sound settings and everything is set properly.  What do I need to do to fix this. Help!

    Though I have doubts for success, you might try a SMC reset.  It can do no harm.  Otherwise, barring suggestions from others, the Apple Store or qualified repair facility is the last option.
    http://support.apple.com/kb/HT3964
    Ciao.

  • I don't have any sound coming from my computer. I checked all the speakers but i still don't have any sound. help!

    I don't have any sound coming from my computer. I checked all the speakers but i still don't have any sound. help!

    Do you have sound coming from the audio output port using headphones?  If so, when the plug is pulled out, is there a red light?
    You may need a PRAM reset:
    http://support.apple.com/kb/HT1379
    Ciao.

  • I have a 27" thunderbolt display NOT the iMac, and I'm trying to connect my xbox 360 to it via the Belkin AV360. I plug everything in and it does not work? I check all the power cables and and connections and still not he issue. Iv'e tried C-F2 also. Help

    I have a 27" thunderbolt display NOT the iMac, and I'm trying to connect my xbox 360 to it via the Belkin AV360. I plug everything in and it does not work? I check all the power cables and and connections and still not he issue. Iv'e tried C-F2 also. has anyone used this devive (AV360) on there own 27" thunderbolt display (not the imac) and gotten it to work? If so I'd appreciate the help.

    There are multiple reasons that lead to issue. You should read the troubleshooting guide to get the right solution to solve the issue: iPhone, iPad, or iPod touch not recognized in iTunes for Windows - Apple Support

  • I bought a $15 app GTA Vice City a while ago and I just started using it and it doesn't work. I checked all the requirements and my laptop meets all of them. I also have contacted Rockstar Games and they didn't help. Can I get my money back? Its annoying.

    I bought a $15 app GTA Vice City a while ago and I just started using it and it doesn't work. I checked all the requirements and my laptop meets all of them. I also have contacted Rockstar Games and they didn't help. Can I get my money back? Its frustruating.

    Hi...
    Apple's policy states that, "all sales are final" >  iTUNES STORE - MAC APP STORE - TERMS AND CONDITIONS
    But since you are not getting any help from the developer, you can use the email form to contact Apple and ask for a refund >  Apple - Support - Mac App Store - Contact Support.
    No guarantees.

  • I need help in finding all the new fontsin iPad 2 using iOS  5

    I need help in finding all the new fonts in ipad 2 using ios 5

    You cannot change the email font. You can make it bold, italics and underline the type, but Helvetica is your only choice in the mail app.
    In the notes app you have 3 choice Noteworthy, Helvetica and Marker Felt. The font can be changed in Settings>Notes>Font.
    You can only use fonts that are built into the app that you are using at the time. You cannot pick and choose fonts from a list of all of the fonts that may be on the iPad but only from the list of fonts that the app allows.

  • My IPad sound keeps turning off. I have checked all the settings nd they are ok. I have to reset it all the time. It is very frustrating as I use it as an alarm, need I say I've waken late a few times.

    My IPad sound keeps turning off. I have checked all the settings nd they are ok. I have to reset it all the time. It is very frustrating as I use it as an alarm, need I say I've waken late a few times.

    I'm having the same problem?

  • When I send a email, the people get it with my daughters email as the one who sent it. I have checked all the settings ...help

    When I send a email, the people get it with my daughters email as the one who sent it. I have checked all the settings ...help

    Does your daughters email address show up as one of the options in the From line as discussed above? If so, try a Reset [Hold the Home and Sleep/Wake buttons down together for 10 seconds or so (until the Apple logo appears) and then release. When the screen goes blank then power ON again in the normal way.] It is 'appsolutely' safe!

  • "You need to restart your computer. Hold down the power button for seve..."

    Hello,
    I have recently been getting this same message "You need to restart your computer. Hold down the power button for several seconds or press the Restart button." whenever I start up my computer. It happens about 95% of the time. I have been reading on different forums that I should reset the PRam and the NVRam and I have been doing so and it does help as it does EVENTUALLY start up (sometimes takes me 5-10 min. to get it to start up).
    I have also read that it may be the RAM that is loose, so I did check that and made sure that the ram is properly placed (which it is).
    I don't know what else I can do. Should I reformat and reinstall Mac OS X?
    Here is the exact error form the dump:
    IOAPIC: Version 0x20 Vectors 64:87
    AppleACPIPlatformExpert::start failed
    panic(cpu 0 caller 0x55c095): "Unable to find driver for this platform: \"Macbook 2,1\".\n"@/SourceCache/xnu/xnu-1504.9.26/iokit/Kernel/IOPlatformExpert.cpp:1389
    Debugger called: <panic>

    Well just got around to installing the new HDD and RAM yesterday, and I am sad to say... that the problem persists. :/
    I reseated the memory and made sure they were in there properly, and I also installed the HDD and ran DiskUtility before I erased/reformatted and installed a fresh version of MacOSX Leopard, then updated to Snow Leopard.
    As long as I am using my computer everything works fine, the problem occurs when the machine is shut off or put to sleep for a long period of time. Because when I shut it off and turn it right back on a few minutes later it works, or if I shut the lid and open it 10-20 min. later everything works fine, it's only when the machine is off or asleep for long periods of time.
    So, I do not know what else can be wrong.
    Should I try to take out the old RAM and just leave the new module in and see if that works out? See if that specific module is faulty?

  • InfoPath form load rule is not checking all the rows in form library

    Hi,
    Requirement:
    We have a form library named "HR Annual Review". In the InfoPath form we have two buttons "Save" and "Submit". User is allowed to Save multiple times and only once using Submit button. The file name of form library "HR
    Annual Review" will be stored in the format “<username>+<mm>+<dd>+<yy>.xml”. Say for example, an user named Mike Walt submitted a form then the file name will be as “MikeWalt012314.xml”. If the same user (Mike Walt)
    submits the form and tries to open the form for subsequent edit, then we need to show a view which has an error info saying “The Appraisal is already submitted for the current appraisal cycle”.
    Solution we tried:
    To achieve the above requirement, we tried using InfoPath Form Load and add a rule to check whether the combination of current user name and the year already exists in the filename column of the form library. But the rule we applied is not checking all the
    rows in the form library. The rule is always checking the first row of the form library.
    What we need:
    We need the validation using InfoPath rule or some other way/solution to check whether the combination of current login username and current year file already exists in the form library.
    Thanks in advance.
    Srivignesh J

    Hi Srivignesh,
    Submit button Uses the Main Data connection to submit the data to the list. This is what you are using and naming the file in the format. You can create secondary data submit that will update the exiting item in the list. With this, you don't have to create
    any rules to check all the rows which is also not possible in OOB InfoPath.
    Once you have the two data connection, hide the toolbar from the form and display these two on the button. For The Submit button, apply the rule to hide the button if created by is not empty. For Save button, apply the rule to hide the button if Created
    By is empty. This way, when a new form is created, you will see the Submit button, and when the user have to update the form, they will see Save button. Hope it help.s
    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

  • Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?

    Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?
    I'm developing an application where a file is need to be saved as pdf. But, if there is already a pdf file with same name in the specified directory, I wish to overwrite it. And in the overwrite case, read-only files should not be overwritten. If the duplicate(old) file is opened in windows (Win7) explorer preview, it is write protected. So, it should not be overwritten. I tried to get the '
    FILE_ATTRIBUTE_READONLY' using MS API 'GetFileAttributes', but it didn't succeed. How Adobe marks the file as read-only for preview? Do I need to check some other attribute of the file?
    Thanks!

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • I cannot find information to help me change the orientation of a video filmed in portrait format but only able to be played back lying on its side  (landscape) instead of upright. All the rotation buttons for iPhoto are not 'engaged' when it is in video .

    I cannot find information to help me change the orientation of a video filmed in portrait format but it can only able to be played back lying on its side  (landscape) instead of upright. All the rotation buttons for iPhoto are not 'engaged' when it is in video .

    Thanks OT,
    I tried the Export function but it would not allow me to choose the option of exporting to iMovie. I think you are right about needing Quicktime Pro. I opened iMovie and imported the clip from iPhoto and with some searching found the 'cropping, rotation' mechanism. So I now have a copy in the correct orientation. I plan to import/export it back to iPhoto because I want to have a copy on my iPhone to show people and I wanted to have it available as part of a slideshow I am making in iPhoto of my recent overseas trip. It is a pain that there is no simple orientating tool for the movie clips downloaded to iPhoto with the photos from the one camera.

  • HT2520 I have an old MacBook Pro running OS 10.7.5.  I would like to sync up my contacts with my iPad.  I have checked all the right boxes in iCloud.

    I have a MacBook Pro running OS X 10.7.5.  I would like to sync my contacts from my iPad with my MAC.  I've checked all the appropriate boxes in iCloud on both devices.  What am I not doing or doing wrong?

    Bobby D,
    Thanks for the help.  I learned quite a bit from your answer.  Turns out I was looking in Outlook for the MAC instead of Address Book on my MAC which already had all my contacts.  Once I imported them to Outlook, problem solved.  It will be interesting to see if when I add a new contact it updates Outlook.
    Thanks again,
    rpayne556

  • I know my network connection is fine and I've checked all the cables and that the tv is set to the correct source, but even though Apple Tv is on and responds with beeps when I hit the button, I see nothing on the screen. What do I do next?

    I know my network connection is fine and I've checked all the cable connections and my television is set to the correct input, but even though the remote beeps when I hit the button, I see nothing on the screen. The troubleshooting section in the setup guide says to make sure that Apple Tv is connected to my network by choosing Settings>General>Network. How do I do this? What do I need to do to get everything back? I've been using the Apple tv for a while now, and suddenly it's doing this.

    This is the iPod touch forum. I requested your posted be moved to the Apple TV forum
    Using Apple TV

  • I need to build an executable which allows all the VIs to be viewed as if in LabView

    I hope I am not being stupid but I need to build an executable which allows all the VIs to be viewed, opened - closed, as if being interpreted by LabView 8.5. The system is a simulator and I am required to allow the system to be inspected for correctness whilst running. Further, interactive panels exist at various locations throughout the structure and they must all work.
    Can somebody tell me how to do this or provide me with some pointers?
    Ideally I would like the navigation to be the same as if the code was being operated within LabView then the same idiots guide, I’ll need it in two years, will work for both the exe and the interpreted versions. The target machines will not run LabView and simply distributing the VI tree would be very bad news because it would allow erroneous edits to break the system.
    Thanks in advance

    Mike
    Sorry I may not have expressed myself well.
    I have developed the system in LabView 8.5 and I now want to release it to be installed on machines without LabView. I can do that, however I have a problem. I am required to allow the internals (the source) of the system to be visable; I don’t know how to do that without LabView on the machine. Yes, I know I could produce PDFs for all 1500+ VIs but I don’t want to do that and the customer does not want it eather; he wants to navigate the model and check what he finds.
    I hope this makes my requirements clearer.
    Thanks
    Frank

Maybe you are looking for

  • ADF Query Panel - Manually editing search fields

    Good Afternoon, I have a Query Panel (View Criteria) that allows users to search for records where the "StartDate" attribute of the EmployeeVO View Object is between two bind variables, "startViewCritVar" and "endViewCritVar". I would like to access

  • One month Basic salary

    How do i config in V_512W_B This is for the WT :Payment in lieu Answer will Rewarded

  • Distance between a li marker and the text

    I know I'm being a little lazy.... What is the way (best or only) to control the distance between a marker for an li (disc, square, etc.) and the text for that li? Thanks Tom

  • Topic: Feedback Forum becoming utterly useless Part2

    Another problem that makes it diifficult to find threads you need to post to is under old system when you received email notifications the subject line of the notifications were identical to the subject line of the actual post. So people knew what fo

  • IMessage MMS size limits ... does anybody know?

    Does anybody know the offical size limit of photos and videos that can be sent between iMessage users? I'm thinking that my wife and I can send unlimited high res videos to each other (both iPhones) for free and not have any limitations with iMessage