Microsoft released PowerShell in 2006 for use on Windows XP and Server 2003. It was upgraded to version 2 as of Windows 7 and Server 2008 R2. PowerShell v2 was also released for use with XP and 2003, though it isn't 100% feature comparable to the version running on Win Vista/7 and Server ...
0
votes
1answer
17 views
Self-signed Certificate ( Makecert.exe or CA )
I have configure PowerShell Execution policy on Server as AllSigned, so i want to create a certificate for signing a ps1 script.
Can you guide me, which Certificate Should i use?
I want to used ...
0
votes
1answer
12 views
Is start-process supported in a powershell step on SQL Server 2008 R2?
With the described configuration, I have a SQL Agent Job that includes a Powershell step. That step throws an error when it gets to the line
$app = start-process -passthru $program $program_args
...
2
votes
1answer
16 views
Export from Saved system log
Using powershell, is there any way we can export system event logs from a saved system event log file (*.evt). Get-Eventlog does not recognize the "-logname "Saved system log"".
Any ideas ?
3
votes
2answers
21 views
How to export all System event logs of a definite time period
I am working on a Windows Server 2003 SP2 with Powershell v2, and I am looking for a way to export all System event logs of a definite time period, (say, from Saturday 2000 hours to Sunday 1100 ...
0
votes
1answer
22 views
OutVariable is broken for Exchange 2010 cmdlets
It seems that OutVariable is broken when using the Exchange 2010 cmdlets. Is it just my server or is this the case for everyone? I observed the following --
get-mailbox jdoe -OutVariable asdf | ...
1
vote
2answers
45 views
Proper Use of -OutVariable in PowerShell
I'm trying to make use of the Common Parameter OutVariable in a simple one-liner PowerShell command, but it's not working the way I think it should (or really at all).
Get-Mailbox -OutVariable mBoxes ...
1
vote
1answer
39 views
Powershell: Wanting Exchange statistics and running into (output) limitations
I am trying to gather mailbox statistics for all mailboxes in our organization, exporting it to an Excel /CSV file. This is the code I came up with /gathered so far:
Get-Mailbox -ResultSize Unlimited ...
0
votes
0answers
10 views
add certificate to all files in EFS-folder with script
I try to set up collective access to EFS-folder. I want to add certificates of all users to all files in folder. Is it posible do with using powershell scripts or some another way?
Thanks.
0
votes
1answer
26 views
Why will my Powershell profile only load for the 32bit version of powershell?
As per this document http://msdn.microsoft.com/en-us/library/bb613488(v=vs.85).aspx I've created a profile in:
%windir%\system32\WindowsPowerShell\v1.0\ Microsoft.PowerShell_profile.ps1
When I run ...
2
votes
1answer
29 views
Are there any good open source developer machine setup scripts for windows/c# development?
I've used thoughtbot's laptop setup script to setup my mac for ruby develpment in the past.
Is there anything similar out there for windows/c# development? Something that sets up IIS, installs visual ...
2
votes
0answers
40 views
Restore more than 250 files using DPM 2010 and PowerShell
I've got what should be a fairly simple task: restore the following files from DPM:
D:\inetpub\wwwroot\*\index.*
I followed the instructions in this TechNet wiki and pretty much thought I had it.
...
0
votes
0answers
26 views
Importing NTFSSecurity module from UNC path fails
I've created a central repository for Powershell modules, but I'm having trouble loading one in particular. The NTFSSecurity module is failing to import with the following message.
PS Z:\> ...
2
votes
1answer
67 views
Grant MODIFY on “All Subfolders and Files” with icacls, but only give Read to top level folder
One of our Windows servers that has some user folders on it has some pretty screwed up permissions. What I want it for SYSTEM and Domain Admins to have full control of all folders. I want the users to ...
2
votes
3answers
30 views
Copy-Item not working as expected
I cant figure out what I am doing wrong with this command and would like another set of eyes to point it out.
I want to copy the directory structure but not the files the structure contains.
...
1
vote
2answers
39 views
Win2k8: How to set a 'Deny File Name Extension' rule in IIS?
Does anyone know how to use Powershell to create a 'Deny File Name Extension' rule, so that certain files will not be served by IIS?
For example, I want to set a rule to deny all .txt files from ...
1
vote
1answer
80 views
Verify who has Bitlocker key backed up via PowerShell?
We currently use Bitlocker on our laptops here at work. The helpdesk are responsible for backing the Bitlocker key up to AD when they build the system. We ran into an issue recently where a user had ...
1
vote
2answers
49 views
Remote Wildcard script mapping from site in IIS 7.5 with powershell
I created a site in IIS 7.5 via Powershell; however, the site inherited the parent handler mappings and one of the wildcard script mappings causes problems for this particular application. Is there a ...
2
votes
1answer
37 views
How do I change Listener port in Powershell/winrm 2.0?
In quite a few places the command for changing the port winrm listens on look like this:
winrm set winrm/config/Listener?Address=*+Transport=HTTP @{Port="8888"}
However this does not work for me. ...
0
votes
0answers
43 views
Add a SQL user similar to a current user via PowerShell?
I'm slowly but surely perfecting a new user script. As it is, my script will do everything to add a new user to our domain, except one thing. We have an in-house program, webpage front end that ...
4
votes
1answer
53 views
Using VBScript at logon to determine if powershell is installed
I have a mixture of Win7, and XP machines on my network. Every user logs on using a VBS based logon script and for clients that support it, I want to show an informational pop-up as shown here.
How ...
1
vote
1answer
56 views
Powershell: undelete messages removed by recipient policy
A specific recipient policy was mistakenly applied to all mailboxes in our company. I have changed the recipient policy to the correct one. I now need to restore (from delete items) all messages that ...
1
vote
1answer
74 views
PowerShell with module vs Exchange Management Shell
We are working on Exchange through Exchange Management Shell and also PowerShell (snap-in Exchange 2010 added).
My point here is that we have two different series of answers.
EMS and PowerShell have ...
1
vote
2answers
89 views
Having difficulty getting multi-line Powershell regex to work - no matches
I referred to several examples I was able to search, which seemed highly pertinent, but am still unable to get this to work.
My input looks like this, from a dhcp server stats command, and I've ...
0
votes
1answer
41 views
How do I grep text in remoting mode
In powershell (2.0) the following works nice and fine:
cmd /c echo "hello" | select-string hello
Outputs "hello".
When running this in remoting mode, text is not printed:
Invoke-Command ...
0
votes
1answer
53 views
Automatic alert/notification of calendar items added to Public Folders
We currently use Public Folders with Exchange 2010. We have a series of shared calendars throughout the organization. Some of the items posted require us to set up devices (video conferencing for ...
1
vote
0answers
40 views
Programmatically retrieve Application Pool Defaults
Using the IIS namespace, one can query the IIS Apppool settings, using:
$pools = get-wmiobject -namespace "root/microsoftiisv2" -query 'select * from IIsApplicationPoolSetting'
However, this only ...
3
votes
2answers
100 views
Why can't I navigate Active Directory within Powershell?
I have an AD: drive, which should allow me to browse active directory from within Powershell. But when I try to use it, it will not let me navigate beyond the root. From what I have read the given ...
1
vote
1answer
79 views
Powershell window preventing shutdown
If I have a PowerShell window (at the PS command prompt) on display it prevents the computer shutting down.
i.e. if I open a powershell window and then try to shutdown the server, I get the End ...
2
votes
1answer
52 views
RD Gateway reporting features/capabilities
We have just implemented RD Gateway for our own department in preparation for a push to the whole agency for telecommuting. It is all setup and working great, but I was trying to figure out how best ...
2
votes
6answers
214 views
email output of powershell script
I found this wonderful script that outputs the status of the current DFS backlog to the powershell console. This works great, but I need the script to email me so I can schedule it to run nightly. I ...
0
votes
0answers
57 views
Powershell Remoting no logon servers available
Has anybody encountered this exception before. I have 2 domains with no trust between them and I need to remote between them. I have this configured and executing in a lab environment however within ...
1
vote
2answers
98 views
IIS 6.0 Windows Server 2003 - how to iterate through all websites using powershell?
How can I iterate through all the websites hosted on an IIS 6.0 (Windows Server 2003) using powershell?
Is there a way to do it using WmiObject ?
Thanks!
1
vote
1answer
104 views
Powershell Exchange script returning inconsistent results - PS weirdness
Maybe someone can shed some light on a bit of Powershell weirdness I've come across and can't explain.
This PS script returns a list of exchange databases, their sizes and the number of mailboxes in ...
3
votes
1answer
98 views
PowerShell Remoting w/ Exchange 2010
I'm having difficulty running Exchange 2010 cmdlets through remote PowerShell sessions.
I start my local PowerShell session as Administrator and issue the following commands --
PS ...
0
votes
1answer
49 views
How to re-run one line of a PowerShell cmdlet if it fails
I wrote a PowerShell script which is supposed to send emails automatically, but sometimes the email won't send out due to a network issue.
Here is how I'm sending email:
...
1
vote
2answers
270 views
How to import a text file into powershell and email it, formatted as HTML
I'm trying to get a list of all Exchange accounts, format them in descending order from largest mailbox and put that data into an email in HTML format to email to myself. So far I can get the data, ...
2
votes
1answer
92 views
Setting up a very mixed Active Directory network to work with PowerShell Remote Administration
Summary: I want to be able to monitor the computers on my network, but don't need it to be automated. We're too small to purchase anything like MOM, but too big to do anything manually (~100 machines ...
0
votes
1answer
90 views
Windows script to detect if Apache is not working and then restart
For development purposes, I'm running an Apache server on my windows machine. Its very non-critical, but sometimes I'll be running processes that take a long time and Apache will stop server ...
2
votes
2answers
39 views
Powershell: Consistent modules accross all servers/workstations
Whats the best way to get consistent modules across our servers and workstations. To put it another way: I want to be able to write a powershell script and have it run on all machines meaning each ...
1
vote
1answer
122 views
Change owner recursively with Powershell?
I'm trying to use Powershell to change owner of a folder, recursively.
I'm basically using this code:
$acct1 = New-Object System.Security.Principal.NTAccount('DOMAIN\Enterprise Admins')
...
3
votes
1answer
174 views
After adding new user to AD via Powershell script, have to reset password?
I've been slowly working on a script that will do everything I normally do for a new employee when they start. So far it all seems to be fine except one thing. Here's what I have:
Loads Quest ...
1
vote
2answers
108 views
Scripting help - need to get phone number of AD accounts and then add them to contacts in trusted domain
I have domain accounts that I have created as contacts in another trusted domain so that they can see them in their Exchange GAL.
I need a way to extract the phone number field from UserA (user ...
1
vote
1answer
69 views
Exchange Powershell - how to create alias as first initial last name?
I have a script that I downloaded off of Technet.
Problem is that it creates the alias as:
-Alias ($_.FirstName + ($_.LastName).ToUpper())
where $_.Firstname is the -FirstName field and ...
2
votes
1answer
113 views
Lync 2010 Group Chat Logging
My group is rolling out Lync 2010 Group Chat and it seems from the documentation that the Lync Server does not log actual conversation history for Group Chat. I find this suspect because if ...
1
vote
1answer
76 views
Create new AD account similar to a current user
I've been working on a PS script that will prompt me for several criteria, then create an Exchange/AD account. It's all going well, but I was thinking, is there a command that will create a new user ...
4
votes
1answer
58 views
How can I reference the output of the first command when chaining Powershell commands
How can I extract one value from the first of a command chain in my output? For example:
Get-ActiveSyncDevice | Get-ActiveSyncDeviceStatistics | ft UserDeviceAgent, Identity -a
The column ...
1
vote
1answer
31 views
Instantiating COM object hnetcfg.fwpolicy2 on Remote Server
I locked my self out by inadvertently changing RDP firewall rule to use IPSec,but without completing proper steps to setup IPSec channel from my laptop to server.
Luckily all wmi remoting on Server ...
0
votes
1answer
58 views
Count open Office Word Files
I have troubles to find a solution for my problem (I am a really beginner of powershell).
I have to count the Office files which are open on a server.
My situation:
A Service account is connected ...
-1
votes
1answer
201 views
How to Get user info from different domain
How to Get user info from different domain.
Get-ADUser -Identity username work with same domain1 but i want to know user info from different child Domain
1
vote
2answers
425 views
How to i execute a powershell script via group policy?
How to i execute a powershell script via group policy to a number of machines?
The script is signed and will run on one of the targeted machines if right click and "run with powershell" is selected. ...