Simple PS 3 Module Not Exporting Variables
Hello,I have been working through issues with automation and modules for a few days, but no matter what I try I can't get a variable to export from a function to another function within the same PSM1...
View ArticleCan multiple Powershell v4 DSC configuration objects be combined on a machine?
I'm working on configuring servers using Powershell Desired State Configuration (DSC). I have several different groups of IIS servers. The configuration for all of them is about 90% identical, but...
View Articleuser input validation
Is there tested PowerShell code available online that performs user input validation for a variety of needs (numeric, numeric in a range, alphanumeric, alphanumeric withing certain size limitations,...
View ArticleDeclaring [T] (Of Type) with Powershell
I'm trying to call a method with Powershell that requires an "Of Type" or [T] according to the OverloadDefinition, Ie.OverloadDefinitions -------------------...
View ArticleNeed help simplifying get-date
I have a script that returns all users from AD who logged in from the last 30 days, but I need to adjust it to make it for the current calendar month. I've got the following code but I could do with...
View ArticleFunctions from Module Scoping Question
Hello,I have the following case:I`m using module that contains several functions, some of them are executing commends in remote sessions. These functions are used from Powershell Script. The issue is...
View ArticlePowerShell SFTP Without PuTTY
I need to upload a series of files to an FTP server via SFTP. I was planning on using WinSCP and the sample script that they provide here but the FTP server I'm uploading to uses a 1024 .rsa key and a...
View ArticleTips or Improvements for my Bitlocker Encryption Test Script
Hi Guys,I just finished a little script to check if a drive is encrypted with Bitlocker. I wanted to post it here to see if anyone had some constructive criticism.Here you go: $computer = import-csv...
View ArticleUser isMemberof Group?
I think I am bumping into the fact that I am using PS for a user facing tool, and most of the examples I find are obviously much more focused on administrator tasks. To wit, I need to just return a...
View ArticleSelect-String pattern
Hello, i have a "big" log file, containing path of files on my HDD.Example:f:\found.000\dir0012.chk\=:54;=?3.tiff f:\found.000\dir0012.chk\=>>4048;.tiff d:\scripts\ps1\testing\16627372.tiff...
View ArticleLoad external powershell script at runtime?
If I have Powershell Script A as the currently executing script, is it possible to have ScriptA dynamically load/execute script B either from filesytem or webservice? How do you dynamically...
View Article[Forum FAQ] How To Automatic Sign In Websites with Windows PowerShell
To sign in the websites, we need to input the username and password, then click sign in. However, in some cases, we need to do this automatically.We can achieve this in Windows PowerShell through the...
View ArticleDoes any encrypted password in a text file expire?
I know this sounds crazy, but I have an encrypted password in a file that works for a while then suddenly stops and I have to recreate the file. And no, the account password itself has not changed....
View ArticleThe Command Get-ADUser -Identity -Properties * No Longer Works Due to a Bug...
The 'Command Get-ADUser -Identity <username> -Properties *' No Longer Works Due to a Bug in PowerShell 4 and Win8-1 ProIt produces the following error:Get-ADUser : One or more properties are...
View ArticleRecursive function can't call itself
Hey guys,I have this script that selects a site from all the sites created in an IIS server:Param($webServers,$cred) # ----------------------------------------------------------------- #...
View ArticleHelp creating a script to move users in and out of an OU based on a time limit
Here's my scenario: we currently have OUs based on the locations of our facilities, we also have a sub-OU(?) underneath it for users that need a group policy applied to them where whitelist...
View ArticleCreating a User in Powershell and Assigning a Role to a User
One of the great things about using Windows Powershell is the ability to assign a role to a user. When you’re organized, things generally run much smoother. Having the ability to create users and...
View ArticleXMLImport from Powershell Script
I have been trying to get XMLImport to work via a Powershell script so I can pull gpresult.xml files into Excel for reporting. In the script I am getting errors. PS D:\GPO Backup> $directory =...
View ArticleCan we show the nested objects in Powershell?
I am adding a .NET type to Powershell session using Add-Type and then creating object of that type using New-Object. This is done as follows:Add-Type -AssemblyName OuterObj$a = New-Object...
View Articlehow to - script to *move* a file from local drive to shared or mapped drive ?
this seems like a simple concept but i'm having trouble doing this.preferably I'd like to use move-item so i don't have to delete the source file.but do i have to somehow tell powershell that this is a...
View Article