2

Has anyone tried installing powershell on a Windows 2000 server? I realize its not supposed to be installed on windows 2000 server and therefore not supported; however the vbscript that runs on it takes 3.5 days to complete which powershell could probably finish in lesser time. Nevertheless, I noticed it just requires .NET 2.0 to run.

thanks in advance.

phill
  • 13,434
  • 38
  • 105
  • 141
  • What VBscript takes 3.5 days to complete? I doubt a Powershell version of the same algorithm of whatever you are doing is going to make a serious impact on a process that is taking 3.5 days. There is probably another problem. – BobbyShaftoe Jan 31 '09 at 03:14
  • The script at this questions is taking 3.5 days to complete. http://stackoverflow.com/questions/483945/vbscript-optimization-how-to-get-faster-file-writing – phill Jan 31 '09 at 05:10
  • the main problem is it pulls all folders in the directory into an array. Then it goes back into the array and one by one checks if the folder is older than 3 months and writes it to a string. After it finishes, the script writes the string to a file – phill Jan 31 '09 at 05:14
  • here is the powershell command: Posh>get-childitem | where {$.name -match "^\d{6}([a-zA-Z]{3}|x31)$"} | where {$.lastwritetime -lt (get-date).adddays(-90)} – phill Jan 31 '09 at 05:16
  • Oh I see. :) Another possibility is to just write a .NET console application to do it. You get all the libraries without all the fuss. – BobbyShaftoe Jan 31 '09 at 12:53

2 Answers2

1

If you have administrator access to the Windows 2000 server in question, you could run PowerShell on a supported machine in the same domain and use set-location to change your working directory to the remote server

cd \\remoteserver\<drive>$\path\to\folder\you\want\to\start\in

You could then run whatever PowerShell script you want on the remote directory. If the folder you are starting in is shared, it is even simpler (you won't need to access the admin share). Or you could map a drive on your machine with PowerShell that links to the target directory.

This might be a smoother option than forcing an install on a non-supported machine.

Steven Murawski
  • 10,959
  • 41
  • 53
0

Yes. This works. Instead of installing Powershell on the server, just remotely talk to it like :-

Set-Location "\\MyServer\D$\wwwportal\MyChangedFileFolder\" 
Get-ChildItem -filter *.txt -Recurse