![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Searching and removing files from an OU. I'm running Windows Powershell 1.0 and would like to know of a way to scan our network of 50+ computers in an ADSI OU to remove certain files from their desktop? I'm trying to remove all shortcuts to a program that no longer exist, and it begins with the characters Vista 8.03. Any help would be great. Thanks, --TJ |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Searching and removing files from an OU. Hi TJ, That's a great request, and PowerShell definitely is the right tool for the job. Assuming that you're running in the context of an administrator of these 50+ computers, you could do this: Get-QADComputer -SearchRoot 'company.com/ComputersOU' | ForEach-Object { Remove-Item -Path "\\$($_.Name)\c$\Documents and Settings\*\Desktop\Vista 8.03*" -WhatIf } Note that I added -WhatIf to show you what the script will do before you actually run it. This supports multiple profiles on each computer, and assumes that the profiles are all stored on the C drive and that you have an administrative share on that drive. Also note that this uses Quest's AD cmdlets. These cmdlets are free and simplify working with AD in PowerShell. You can find them here: http://www.quest.com/activeroles-server/arms.aspx -- Kirk Munro Poshoholic http://poshoholic.com <techjohnny@xxxxxx> wrote in message news:7f9d985e-f13b-423b-8d01-8ee0d486b84a@xxxxxx Quote: > I'm running Windows Powershell 1.0 and would like to know of a way to > scan our network of 50+ computers in an ADSI OU to remove certain > files from their desktop? > > I'm trying to remove all shortcuts to a program that no longer exist, > and it begins with the characters Vista 8.03. > > Any help would be great. > > Thanks, > > --TJ |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Searching and removing files from an OU. It seems that the editor I am using decided to try and treat it as a path. Here's a substring of the middle of the Path property I listed in my original post: ....$($_.Name)\c$\Documents and Settings\*\Desktop\... I should also mention that once you install the Quest AD cmdlets, you'll have to add them to PowerShell to be able to call Get-QADComputer using the following command: Add-PSSnapin Quest.ActiveRoles.ADManagement Please let me know how it works out for you. -- Kirk Munro Poshoholic http://poshoholic.com "Kirk Munro" <sorry@xxxxxx> wrote in message news:ePhjOorMIHA.1164@xxxxxx Quote: > Hi TJ, > > That's a great request, and PowerShell definitely is the right tool for > the job. > > Assuming that you're running in the context of an administrator of these > 50+ computers, you could do this: > > Get-QADComputer -SearchRoot 'company.com/ComputersOU' | ForEach-Object { > Remove-Item -Path "\\$($_.Name)\c$\Documents and > Settings\*\Desktop\Vista 8.03*" -WhatIf > > } > > Note that I added -WhatIf to show you what the script will do before you > actually run it. This supports multiple profiles on each computer, and > assumes that the profiles are all stored on the C drive and that you have > an administrative share on that drive. > > Also note that this uses Quest's AD cmdlets. These cmdlets are free and > simplify working with AD in PowerShell. You can find them here: > http://www.quest.com/activeroles-server/arms.aspx > > -- > Kirk Munro > Poshoholic > http://poshoholic.com > > > <techjohnny@xxxxxx> wrote in message > news:7f9d985e-f13b-423b-8d01-8ee0d486b84a@xxxxxx Quote: >> I'm running Windows Powershell 1.0 and would like to know of a way to >> scan our network of 50+ computers in an ADSI OU to remove certain >> files from their desktop? >> >> I'm trying to remove all shortcuts to a program that no longer exist, >> and it begins with the characters Vista 8.03. >> >> Any help would be great. >> >> Thanks, >> >> --TJ > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Searching and removing files from an OU. On Nov 29, 11:53 am, "Kirk Munro" <so...@xxxxxx> wrote: Quote: > It seems that the editor I am using decided to try and treat it as a path. > Here's a substring of the middle of the Path property I listed in my > original post: > > ...$($_.Name)\c$\Documents and Settings\*\Desktop\... > > I should also mention that once you install the Quest AD cmdlets, you'll > have to add them to PowerShell to be able to call Get-QADComputer using the > following command: > > Add-PSSnapin Quest.ActiveRoles.ADManagement > > Please let me know how it works out for you. > > -- > Kirk Munro > Poshoholichttp://poshoholic.com > > "Kirk Munro" <so...@xxxxxx> wrote in message > > news:ePhjOorMIHA.1164@xxxxxx > Quote: > > Hi TJ, Quote: > > That's a great request, and PowerShell definitely is the right tool for > > the job. Quote: > > Assuming that you're running in the context of an administrator of these > > 50+ computers, you could do this: Quote: > > Get-QADComputer -SearchRoot 'company.com/ComputersOU' | ForEach-Object { > > Remove-Item -Path "\\$($_.Name)\c$\Documents and > > Settings\*\Desktop\Vista 8.03*" -WhatIf Quote: > > } Quote: > > Note that I added -WhatIf to show you what the script will do before you > > actually run it. This supports multiple profiles on each computer, and > > assumes that the profiles are all stored on the C drive and that you have > > an administrative share on that drive. Quote: > > Also note that this uses Quest's AD cmdlets. These cmdlets are free and > > simplify working with AD in PowerShell. You can find them here: > >http://www.quest.com/activeroles-server/arms.aspx Quote: Quote: > > <techjoh...@xxxxxx> wrote in message > >news:7f9d985e-f13b-423b-8d01-8ee0d486b84a@xxxxxx Quote: > >> I'm running Windows Powershell 1.0 and would like to know of a way to > >> scan our network of 50+ computers in an ADSI OU to remove certain > >> files from their desktop? Quote: Quote: > >> I'm trying to remove all shortcuts to a program that no longer exist, > >> and it begins with the characters Vista 8.03. Quote: Quote: > >> Any help would be great. Quote: Quote: > >> Thanks, Quote: Quote: > >> --TJ Thanks, --TJ |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| RE: Searching for files | Vista General | |||
| Re: Searching for files | Vista General | |||
| Searching for files | Vista General | |||
| searching files | Vista General | |||
| removing associated Norton files form windows security as it still appears in security centre after removing from registry, application common folders etc | Vista security | |||