I often access shared network folders in Powershell to grab files etc. But if the share requires a username/password, Powershell does not prompt me for these, unlike Windows Explorer. If I connect to the folder first in Windows Explorer, Powershell will then allow me to connect.
How can I authenticate myself in Powershell?
...
I recently discovered Powershell and through that PSake. If you are using it and you've extended it or created tasks for it, please share!
...
I know I can access environment variables in powershell using $Env. For example, I can access FOO with $Env:FOO
What I can't figure out is how to access the environment variable called FOO.BAR
$Env:FOO.BAR doesn't work. How can I access this from within Powershell?
...
Does anyone have a Powershell script to change the credentials used by a Windows service?
...
I'm trying to use powershell to configure the account credentials, but I need to grant the account "Log on as a service" right in order for it to work. How can I do this in powershell?
...
I just recently found out that exchange server2007 will no longer be supporting WMI, namely the service which uses \ROOT\MicrosoftExchangeV2. The old script I wrote output the ServerName, StorageGroupName, Storename, MailboxDisplayName, Size, TotalItems, DeletedMessageSizeExtended fields to a csv text file.
How would I go about doing...
I'm sure this must be possible, but I can't find out how to do it.
Any clues?
...
How would I set the "overwrite as needed" setting on Event logs other than Application/Security/System? Specifically I'd like to apply this to the Powershell and Windows Powershell Logs, in addition to any other future logs that may be added. This needs to be applied to both server 2003 & 2008.
...
Do you know of any good remoting solutions using powershell V1 (I know the V2 stuff is awesome, but my organization doesn't like using pre-release software). I don't need anything spectactular, just a way to kick off powershell script on another box and get the results back when they're done. I'm considering using sysinternals PSEXEC a...
Given test.txt containing:
test
message
I want to end up with:
testing
a message
I think the following should work but it doesn't:
Get-Content test.txt |% {$_-replace "t`r`n", "ting`r`na "}
How can I do a find and replace where what I'm finding contains CRLF?
...
I'm trying to change a site's home directory using powershell. This is what I have so far, but it isn't saving the changes...
$server = "localhost"
$siteName = "mysite"
$iis = [ADSI]"IIS://$server/W3SVC"
$site = $iis.psbase.children | where { $_.keyType -eq "IIsWebServer"
-AND $_.ServerComment -eq $siteName }
$path = [adsi]($si...
I have written a database application using a binary file as storage. it is accessed via powershell cmdlets.
You can put information into the database using the put- and you can read information using get-.
The problem is synchronisation. What is the best way to ensure that the cmdlets don't access the file at the same time?
The put- ...
When I run get-user|get-member in powershell with the exchange add-in I noticed there is no description property.
Does anyone know if it has been renamed to something else or another way of accessing it?
...
I wrote this small script to pull the office property from get-user by piping the exchange mailbox object.
$server = "tms08"
$arrUser = get-mailbox -Server $server |Get-MailboxStatistics |select identity
foreach ( $id in $arrUuser)
{
$office = get-user -Identity $id.Identity |select office
$out += $id.Identity
}
$out
I don't get any...
I'm looking for a way to programatically change features ("Programs and Features" -> "Turn Windows Features on or off") in Windows Vista (and newer Redmond OS, e.g. Server 2008).
Ideal solution would be in the form of a Powershell script (Get-Features, Set-Features), however any pointers to MSDN/other documentation would be very welcome...
Is there a way to query against exchange 2007 to distinguish who is either an active sync or blackberry user using powershell exchange addin?
...
What is the best way to send HTTP requests from Windows Powershell?
...
I'm having trouble setting up a scheduled task (now called Task Scheduler) under the actions tab to run on windows 2007 server. It also has exchange server 2007.
I've tried setting
Program/script : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add arguments (optional): -psconsolefile exshell.psc1 -command "& {c:\mes-detai...
I've heard powershell 2.0 CTP has modules, but I can't find much example code or instructions. I've read what little help there seems to be online...
But I just keep getting "The term 'Add-Module' is not recognized as a cmdlet..." when I try and load a module.
Any help would be gratefully received!
Edit (July 2010)
Please note this qu...
I'm attempting to eliminate leading any leading zeroes in my date when I run the get-date cmdlet by trying:
$filedate = get-date -uformat "%m-%d-%Y"
$filedate = $filedate.ToString().Replace("0", "")
this returns "01-04-2008"
I want to the output to be "1-4-2008"
any ideas on another way of doing this?
thanks in advance
...