Get latest updates of PowerShell from Reddit. Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
I'm trying to build a script that will create mailboxes in Exchange 2016 for our hosting environment. Because we have a lot of clients, I'd like to define the mailbox format in a .conf file for each client, where I also define the user's OU, custom attributes, etc.
Currently, for example, this line returns the correct format when run in the shell:
$firstName.SubString(0,1) + $lastName
However if I try to import and run that line from the text file using
I must be googling this question wrong, but I haven't been able to find an answer.
We recently switched from using domain admin accounts for everything to only using them when necessary. Yay!
I have a script that accesses remote admin shares and moves some files around. Since I'm no longer running everything as a domain admin, the script fails when it tries to access those shares. How can I have the prompt me for admin credentials so it can get there?
For a super simple example, say my script just does this:
If I'm logged in as a domain admin, it opens the explorer window to that folder. If I'm not, it tells me it can't find the path because it doesn't exist. How can I fix that short of changing permissions on the folder? I know about Get-Credential, but it gives an error that "the FileSystem provider supports credentials only on the New-PSDrive cmdlet."
I'm trying to get a script to work that will send an email, both addresses are the same (Gmail- from this video, I've tried using different FROM addresses and SMTP server names and I'm a bit confused as to why this doesn't work.
Can any of you recommend a book or web resource that steps quickly through the basics with lots of examples (and permutations of examples), with perhaps more of an emphasis on getting external data (images, text) from publicly-posted PHP-generated web sites, and writing simple database and/or CSV-type records to local files?
I'd like to use PowerShell scripting to help simplify various personal projects, but most resources seem to be structured like:
Introduction: This is a computer!
Step 1: This is a trivial example!
Step 2: This is an only slightly less trivial example!
Step 3: This is 43 lines of code that does something specific we (not you, the reader) wanted to do, and you'll obviously understand it because you know every other command available in PS! There will be no more examples!
Are there any options other than using WinRM for pushing commands to remote machines?
I want to grab the ReleaseId of the OS from the remote machine and save it to a local csv, and also want to silently install applications in the background and reboot but everything I find requires WinRM to be running. I am not able to run WinRM on these specific machines.
I am still in the learning stages with PowerShell and am working on a script to pull event log information from our domain controllers for two event IDs. I create the script and it works but I am getting errors with the function that merges CSVs together and was wondering if anyone had some suggestions on how I can fix it or make this script better. I didn't make the function my self, I pulled it from https://gallery.technet.microsoft.com/scriptcenter/CombineMerge-multiple-CSV-23a53e83. Below is the Paste Bin link to my script that I am working on. Any help would be appreciated.