Tagged Questions

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 ...

learn more… | top users | synonyms (1)

0
votes
1answer
21 views

powershell formatting of a date stored as int64

I'm am trying to get a list of the users in my AD Domain along with their password expiration. I have this so far in PowerShell: get-aduser -filter * -properties "msDS-UserPasswordExpiryTimeComputed" ...
1
vote
2answers
23 views

Exchange 2010 Powershell command to check if an email address exists in the system

I'm looking for an Exchange 2010 command that would do the following: Given an email address (fully-qualified with domain and all) check if the email address is associated to some mailbox or group ...
3
votes
0answers
16 views

Adding a self-signed cert into trusted certificates list with powershell on Windows 7

I created a self-signed certificate on Windows 7 and deployed a web site with this certificate just to try it out. When I configured the HTTPS endpoint and visit the site with HTTPS protocol, I get ...
1
vote
1answer
43 views

Powershell unrar with wildcard

I'm trying to extract about 40 folders with each containing a rar, but I never have done in it powershell. In bash you can use /.rar to extract them using a wildcard, but how do I this in powershell ...
1
vote
1answer
26 views

Using Win32_FileSpecification WMI instances

I am trying to get a checksum of a remote file using Win32_FileSpecification class via WMI, but am running into a few problems. It uses CheckID as the key, which looks to be similar to the path with ...
3
votes
2answers
75 views

Is there a .history file on Windows machines?

Is there an auditable file on a Windows machine that shows the command-line history for either cmd or PowerShell? On UNIX machines I believe there is a hidden file in the home directory called ...
3
votes
1answer
21 views

SQL Server PowerShell cannot find path error

I cannot use Set-Location to change to a database. I have loaded the SQL Server snapins. I can use Set-Location to get to SQL\Localhost\SQLEXPRESS\, and I can show the paths under the server node with ...
0
votes
0answers
17 views

API equivalent for New-MailContact

Is there an API equivalent (like EWS) for the New-MailContact cmdlet, which would allow me to create an Exchange 2010 mail contact from an existing AD contact? I know that I could invoke a PSSession, ...
3
votes
3answers
111 views

Direction for Scripting

I'm administering a network and they use a few scripts here. Mostly batch scripts or vbscript. It's a Windows environment, mostly Server 2008 with a few 2003 servers. My question is Should I learn ...
2
votes
2answers
26 views

Export entire Windows Log to XML

I want to create a printer statistic and I have a simple but powerfull XML parser. So I want to export all Events from the printer log to the XML format. The print server runs Win2008R2. When I want ...
2
votes
0answers
43 views

Purge print driver cache on windows 7 with powershell script

[Background] We have been having trouble with our network clients suddenly being unable to print. They get an odd error with a hex code. We determined that something in the driver was messed up and ...
2
votes
2answers
66 views

With powershell, how do I find out which user is running a service?

As mentioned in the title, how to find out which user is running a service with powershell?
3
votes
1answer
103 views

When do the user logon scripts run?

I have several user logon scripts defined in active directory. These are batch scripts as well as powershell scripts. When do these actually run? Does the user see "black terminal boxes" when he logs ...
1
vote
1answer
124 views

powershell and remote signing

I've created a power shell script to run on start-up but its not working. I've never run a script through group policy so i don't know what the restrictions/best practices are. I've been told i need ...
5
votes
2answers
70 views

How to get a user's privileges?

I can get the logged in user's privileges in powershell like so: whoami /priv How do I do this for a user I'm not logged in as?
1
vote
2answers
106 views

Powershell script to find outlook duplicates

We are migrating users from Notes to Exchange 2010 using BinaryTree, some how we accidentally migrated ...
1
vote
2answers
79 views

GPP Registry Item Level Targeting in PowerShell

Is there any way to add item level targeting to an existing GPP Registry item via powershell? I'm in the process of streamlining my build process and I have come up empty for anything item level ...
0
votes
1answer
87 views

Move-ADObject Error Parent Object Uninstantiated

I am getting the following error when trying to move a user from one domain to another in active directory "Move-ADObject : The operation could not be performed because the object's parent is either ...
1
vote
2answers
77 views

How do I set an environmental variable from a powershell command?

I want to have a environment variable that contains the day of week in cmd.exe. When I run this command I get the result I want. C:\Users\tisc>powershell (get-date).dayofweek Friday Here I'm ...
1
vote
0answers
33 views

Exchange 2003 Strip Email Attachments save to User file

I'm currently using this vba script (locally on client) to strip email attachments from user's folder to and move to user document folder and then replace with a pointer in the email to reference the ...
0
votes
1answer
40 views

Exchange Server 2010 SP1: Powershell scripting

How can I get a list of users that got the checkbox unchecked for advanced security "Allow inheritable permissions..." on the Exchange Server 2010 ? How can I enable it bulk using AD PowerShell?
4
votes
1answer
90 views

Finding the most recent modification date of all files/subfolders in all top-level directories of a share with PowerShell

I have a shared directory tree on a Windows 2003 file server that has about 100GB worth of data in it. I need to find all top-level directories in this share where the last modification time for every ...
0
votes
1answer
43 views

How to look for a user terminal session in powershell

I would request some help on finding a user on a terminal session (like Citrix). I've gone through most of the questions asked on "Terminal Session" on this forum. Unfortunately, nothing really helped ...
0
votes
1answer
49 views

Detecting when Windows installation is completed

I got the task to install Windows Server 2008 R2 inside a virtual machine (WMWare Workstation) with Powershell. It was quite easy to do the installation of Windows inside the virtual machine. Now, I ...
0
votes
1answer
71 views

Waking up web server using powershell script?

I'm building a script that perform http request in order to "wake up" some asp.net applications. The following script is working, but is synchronous : function WakeUp([string] $url) { Write-Host ...
1
vote
2answers
125 views

How can I set IIS Application Pool recycle times without resorting to the ugly syntax of Add-WebConfiguration?

I have been scripting the configuration of our IIS 7.5 instance and through bits and pieces of other peoples scripts I have come up with a syntax that I like: $WebAppPoolUserName = "domain\user" ...
4
votes
1answer
55 views

Why does ForEach behave differently than % even though they are both aliases of ForEach-Object in Powershell?

For some reason the % alias for ForEach-Object throws an exception when using the ( $Thing in $Things) syntax while the ForEach alias works fine. Here are two examples: Using the % alias: $ints = ...
1
vote
1answer
30 views

Cannot change default OU for new Distribution Groups in Exchange 2010

I'm trying to use the following command to set the default OU for new distribution groups in Exchange 2010: Set-OrganizationConfig -DistributioNGroupDefaultOU 'corp.company.com/Employees/MailingList' ...
1
vote
0answers
36 views

How to show disabled/enabled status in Exchange 2010 EMS

I'm using this little script to show me the size of mailbox, usage, lastlogontime of all users mailboxes. Get-MailboxDatabase "MDB01" | Get-MailboxStatistics | Sort totalitemsize -desc | ft ...
4
votes
3answers
117 views

NTFS Permissions Auditing with PowerShell

I am working on a project where I need to be able to audit various users and user group permissions on a NTFS formatted Windows file server. I would like to use PowerShell and have it recursively ...
5
votes
1answer
65 views

How to find out users without SEND AS SELF flag in Exchange 2010

I'm looking for a way to find all users who don't have SEND AS SELF flag set in Exchange 2010. Without that flag users aren't able to send emails thru SMTP and it seems some users are missing this ...
0
votes
1answer
101 views

Migrating mailboxes from EXCH 2007 to EXCH 2010 based on message class

Is it possible through a powershell command to migrate mailboxes with the option of ignoring particular message classes, or even better, is there an option to ignore specific ones (ie. Inbox IPM.Note) ...
1
vote
1answer
138 views

Exchange 2010 Export of PST with Date Range

I'm trying to Export one of our Mailboxes into a .PST file and having problems finding the right cmdlets. We are trying to export the past 30 days of a users mailbox, both Received and Sent into one ...
0
votes
1answer
48 views

Powershell Export-Clixml object manipulation

I want to be able to save an object to file, and then have another script pick up that object again and be able to use it. I run Export-Clixml -InputObject $object -Encoding UTF8 -Path $file to ...
1
vote
1answer
84 views

Using Powershell's Invoke-command to install .exe on remote computer

I have an .exe I would like to install on a large farm of Windows Server 2008 computers. I am attempting to use Powershell remoting. I have this command which works locally: invoke-command {& ...
1
vote
1answer
89 views

How do you list users in Exchange Powershell on an Exchange 2007 environment?

I'm trying to verify that I've added a user in our Domain to a shared mailbox. I've used the command in the exchange powershell console: add-mailboxpermission 'shared mailbox name here' -User: ...
0
votes
1answer
121 views

Folder with a million files - how to use Powershell to limit the returned file list to a maximum number of files and avoid the hours-long wait?

I have a directory that inadvertently had about 1.4 million files generated into it. I want to list just the first, say, 100 items, but without the underlying process trying to read the entire ...
1
vote
2answers
52 views

How can I add mulitple user or values to an Array

I wanna create a powershell script in which I want to add multiple values to an Array (Add into Array). eg: I have 10 users in my company and want to create their AD account (without using csv ...
1
vote
1answer
62 views

Hide powershell.exe from the desktop when its start

Greeting, I have this code that will run when windows startup. The code simply will kill explorer.exe and start remote desktop connection program even a user exit the program it will be restart again. ...
1
vote
1answer
69 views

Re-run remote desktop after a user log off from the server

Greeting, I have about 20 PCs with windows 7 home edition and I want users when turn on these PCs have only one option to connect to the server using remote desktop connection. I wrote a power-shell ...
0
votes
2answers
103 views

pass paramter to Schtasks

how can i run schtasks from command line such that i can pass in parameters during run time. i have a batch job which expects parameters during run-time that is created in scheduled task. i cannot ...
0
votes
2answers
82 views

Powershell script works from command line, not from task scheduler. Why?

This is driving me crazy! My powershell script works from the command line, but not from task scheduler. This is Powershell v1 on Server 2008 R2 Enterprise. From the command line, I type: c:\> ...
0
votes
1answer
84 views

Need PowerShell script to automatically hide disabled users from GAL in Exchange 2010

I'm looking for a PS script that will automatically hide all disabled users from the GAL. I ran the below command but it didn't actually hide anything so I'm thinking I must be missing something. ...
0
votes
2answers
47 views

Accessing remote server paths with Powershell environment variables

How do you do the equivalent of using a remote server's $env namespace without hardcoding network paths for cmdlets like Set-Location? I have a script that loops through remote servers and I'm trying ...
0
votes
1answer
59 views

Use Powershell to read XML comments

So I'm working on a way to use Powershell to get a list of scheduled tasks. Through my research, I determined that the only way to get "most" tasks is to use SCHTASKS. This command does allow for XML ...
0
votes
2answers
33 views

Outputting to console, but on the same line as the last output in PowerShell

I'm writing a script to backup our SVN repositories, based on http://www.codeproject.com/KB/powershell/SVNBackupPower.aspx. It works sweet, but when it's waiting for the ZIP to complete, I'd like it ...
1
vote
1answer
53 views

Get-ExchangeCertificate: “The requested key container was not found”

I'm having some certificate issues with my Exchange 2007 server. I only know how to check the certificate information using cmdlets, however I have a limited scope on being able to use them. When I ...
3
votes
1answer
52 views

Redirect stderr to variable in powershell

I would like to script a dcdiag test to alert me if it finds any errors. I thought I may able to do this in powershell by... $test = dcdiag 2>$err I don't have any errors from dcdiag at the ...
0
votes
1answer
218 views

What PowerShell/WSMan clients or queries are consuming more than 1000 requests per 2 seconds?

Exchange 2010 remote administration tools are complaining with the following error [txexmb02.ibm.com] Connecting to remote server failed with the following error message : The WS-Management service ...
0
votes
2answers
105 views

How can I count instances of a regex match in a log file using PowerShell?

I have a very large log file in which I need to count the occurrences of all the variations of a particular string; that is: There are a large number of file IDs that appear in the format AA000####. ...

1 2 3 4 5 13