| Topic |
 |
RE: List AD Group Members with NTAccountName Two other options come to mind. Depending on your network/domain/workstations there is an Active Directory module that you can use: http://technet.microsoft.com/en-us/library/dd378937(v=ws.10).aspx?ppud=4 Second option is harder but it's doabl ... by Ayth in Active Directory on 21 May 2012 08:57 AM
|
 |
RE: Scheduled Job Behaves Differently I totally agree with EBGreen on this one. I've scheduled many a powershell tasks but they are always tricky. Point the task to powershell.exe and use the command line arguments to execute the script. Final gotcha is to check the execution policy, yo ... by Ayth in General PowerShell on 15 May 2012 05:58 AM
|
 |
RE: Sorry very basic question. Appending text and variables to a file. Just for curiousities sake have you look at the functionality of Out-HTML? In theory you could go: $user | Select-Object Name,PasswordExpires | Out-HTML | Add-Content -path $html_report_file I don't know how you build $user or else the code mi ... by Ayth in General PowerShell on 01 May 2012 07:53 AM
|
 |
RE: "To" is a readonly property. POSH 1.0 shouldn't stop you from accessing the .NET object for sending an email, heck that's the way we had to do it back in the old days :). However, if your plan is to upgrade to 2.0 a better way of doing this may be to check out the cmdlet Sen ... by Ayth in Exchange Server on 01 May 2012 05:12 AM
|
 |
RE: "To" is a readonly property. Try changing: email.To=$To to this: email.To.Add($To) by Ayth in Exchange Server on 01 May 2012 03:46 AM
|
 |
RE: Launch powershell without my profile Launch Powershell.exe with the -noprofile switch. That should do the trick. For other switches available check here: http://technet.microsoft.com/en-us/library/dd315276.aspx by Ayth in General PowerShell on 22 Feb 2012 05:24 AM
|
 |
RE: Cisco Phone Serial Number Best I can think of, is that since Cisco IP Phones do provide http management. You can load the webpage and parse it for the serial number. WMI will not work, as WMI stands for Windows Management Instrumentation, meaning it will pull info from W ... by Ayth in General PowerShell on 21 Nov 2011 07:38 AM
|
 |
Custom Transport Agent Hello,This isn't strictly Powershell, but with Powershell being built on .NET and C# I know we have a few developers in the house.Basically I've been tasked with building a custom transport agent that will modify the body of messages based on certai ... by Ayth in Exchange Server on 05 Aug 2011 09:31 AM
|
 |
Getting Folder Size Hey All,I wanted to open a discussion on your experiences in getting the folder size of very large folders, upwards of 30GB with tens of thousands of files. We are no doubt all aware of the simplest method:Get-Childitem \\server\share\folder -Recurs ... by Ayth in General PowerShell on 20 Jul 2011 11:08 AM
|
 |
RE: How do I get a list of users that do not have a SIP email alias Your welcome. Glad it worked for you. by Ayth in Exchange Server on 15 Jul 2011 11:48 AM
|
 |
RE: Cannot execute “Active Directory” cmdlets using the powershell.exe “-command” option. Within your script, ie your ps1 file, simply add in: Import-Module ActiveDirectory That should load the module and allow you to use the cmdlets. by Ayth in Active Directory on 15 Jul 2011 11:46 AM
|
 |
RE: How do I get a list of users that do not have a SIP email alias Just re-reading your original post and you wanted users who do have a mailbox right? This is modified from above: Get-ADUser -filter * -Properties homeMDB,msRTCSIP-PrimaryUserAddress | where-object {($_."msRTCSIP-PrimaryUserAddress" -eq $null)-an ... by Ayth in Exchange Server on 14 Jul 2011 10:17 AM
|
 |
RE: How do I get a list of users that do not have a SIP email alias All is not lost. Even though you are expanding the emailaddresses property, you can still carry properties from the Get-Recipient cmdlet. Like so: Get-Recipient user| Select-Object Displayname -ExpandProperty EmailAddresses | ? {$_.Prefix -eq "SI ... by Ayth in Exchange Server on 14 Jul 2011 10:15 AM
|
 |
RE: Get-mailbox command to show if account status (disabled or not) In order to make those attributes show up in the end result you'll need to add them to the array within the Foreach block. Also I should explain a little about what we are doing here, see the revised code with some comments: # Get a list of all u ... by Ayth in Exchange Server on 07 Jul 2011 09:17 AM
|
 |
RE: Get-mailbox command to show if account status (disabled or not) Actually there is a little problem with the If statement there, wasn't evalutating right. try this: $users = Get-User -RecipientTypeDetails UserMailbox | Select-Object DisplayName,UserAccountControl $result = @() ForEach ($user in $users) { ... by Ayth in Exchange Server on 07 Jul 2011 08:52 AM
|
 |
RE: Get-mailbox command to show if account status (disabled or not) You're welcome. It looks like they've changed it around from 2007 to 2010. The UserAccountControl property is no longer available with Get-Mailbox, but it is with Get-User. So assuming you want to A) Get all users who have a mailbox, and then pri ... by Ayth in Exchange Server on 07 Jul 2011 08:46 AM
|
 |
RE: Get-mailbox command to show if account status (disabled or not) That might be the difference I ran that in a 2007 environment. Will have to connect to our 2010 site. Give me a few. by Ayth in Exchange Server on 07 Jul 2011 08:31 AM
|
 |
RE: Get-mailbox command to show if account status (disabled or not) What version of exchange are you running? by Ayth in Exchange Server on 07 Jul 2011 08:23 AM
|
 |
RE: Get-mailbox command to show if account status (disabled or not) Take a look at the UserAccountControl property of what's returned with Get-Mailbox. I just looked at one of my disabled users, and it says: DisplayName UserAccountControl ----------- ... by Ayth in Exchange Server on 07 Jul 2011 08:16 AM
|
 |
RE: creating generic exchange accounts Also check out this post which I replied to. The guy needed to do the same thing, http://www.powershellcommunity.org/Forums/tabid/54/aft/6735/Default.aspx. by Ayth in Exchange Server on 07 Jul 2011 07:34 AM
|
 |
RE: creating generic exchange accounts Try something like this: $password = Read-host "Enter password" -AsSecureString 1..4500 | Foreach {New-Mailbox -Name "TempUser$($_)" -database -password $password} I may be missing some required parameters when creating a new user but that s ... by Ayth in Exchange Server on 07 Jul 2011 07:19 AM
|
 |
RE: wmi object properties types problem/question Remove the gm from your command. Its an alias for Get-Member and is causing the problem. I've done this hundreds of times myself. I'm guessing at some point you used gm to see all the properties. by Ayth in General PowerShell on 01 Jul 2011 01:31 PM
|
 |
RE: Noob question: Calling functions from a separate file Check out Get-Help about_Profiles You're going to want to place the code from CommonFunctions.ps1 into the profile. That way when powershell starts up it will load the profile and your functions. Then you can call them from command line or via a ... by Ayth in General PowerShell on 29 Jun 2011 06:45 AM
|
 |
RE: Inserting a parameter Since it looks like you are writing a script for a specific purpose, I'm guessing it's going to be saved as a script file, .PS1 and will be executed from the command line. If so I'd package a parameter into the script. For example, save this as some ... by Ayth in General PowerShell on 27 Jun 2011 11:23 AM
|
 |
RE: Noob: Get-ChildItem help Instead of using Name, use FullName. That will give you the full path to the file. dir -r | Select-Object CreationTime, LastWriteTime, @{Name="Kbytes";Expression={ "{0:N0}" -f ($_.Length / 1Kb) }}, FullName > D:\filelist.txt by Ayth in General PowerShell on 24 Jun 2011 05:56 AM
|
 |
RE: Remove outdated/stale Activesync partnerships in Exchange 2007 Well using Karl's code, which is agreed to be a better option. Get-CASMailbox -ResultSize unlimited -Filter{(HasActiveSyncDevicePartnership -eq $true) -AND (name -notlike "cas_*") -AND (name -notlike "DiscoverysearchMailbox*")} | ForEach {Get-Act ... by Ayth in Exchange Server on 22 Jun 2011 06:56 AM
|
 |
RE: How to format output? Hey Mr.Mind, The results you are getting above are correct based on the code. The reason it's outputting like that, is because as with most things Powershell deals in Objects, and $LastTime is an object, that has a property of TimeStamp. Change y ... by Ayth in Exchange Server on 21 Jun 2011 07:23 AM
|
 |
RE: Setting Mailbox Limits That actually is what is done right now. Using Get-MailboxStistics without specifying a mailbox returns all mailboxes. Give it a try in the shell to confirm. by Ayth in Exchange Server on 17 Jun 2011 07:04 AM
|
 |
RE: Setting Mailbox Limits Close, I'd actually use Where-Object in the pipeline to filter out the mailboxes lower than your threshold, like so: Get-MailboxStatistics | Where-Object {$_.TotalItemSize -gt "1073741824"} | Select-Object DisplayName,@{Expression={"$($_.TotalIte ... by Ayth in Exchange Server on 17 Jun 2011 03:29 AM
|
 |
RE: Setting Mailbox Limits Provided you are running at least Exchange 2007 this should work. No guarantees: Get-MailboxStatistics | Select-Object DisplayName,@{Expression={"$($_.TotalItemSize.Value.ToMB()*1.10)MB"};Label="WarningQuota"},@{Expression={"$($_.TotalItemSize.Valu ... by Ayth in Exchange Server on 16 Jun 2011 11:11 AM
|