Quantcast
Channel: PowerShell
Browsing all 15370 articles
Browse latest View live

Powershell Query to export security log user data from DC?

Hi All,Please note I'm a PS noob. I need to query a user's log on, log off and failed attempts from the last 7 days. Filtering the log isn't working as its huge (something else I'm working on fixing)...

View Article


Help with Backup File Cleanup

Hi guys!I've got backup folders like d:\ backup\ \ \ Backups are created every day for 2 databases.I need to clean backups for previous month and leave 2 backups with 2 week difference.So i need to...

View Article


Import-CSV Oddity

This is more out of curiosity than anything else as to why it is happening, but the process is not creating what I would consider a normal array. I created the spreadsheet manually with column headings...

View Article

Finding Stale Active Directory Servers with PowerShell

Afternoon PowerShell People,I'll get right to it, what metrics would you use to determine if a server is stale in Active Directory? We have lastmodified fields and lastlogon, but what's a good policy...

View Article

PowerShell Errors

Im running a script to export a list of users in a AD Group.TextImport-Module ActiveDirectoryGet-ADGroupMember -identity “Domain Admins” | select name | Export-csv -path C:\ Domain Admins.csv...

View Article


Create Powershell commands from Excel

I know this is possible to do, but can't seem to recall how to do it.  I have an Excel file with the Name, GroupCategory, GroupScope, and Path for AD Groups.  Is there a way to use concatenate to...

View Article

Insert Global Security group into Domain Local groups with CSV

I have a CSV that lists Global Security groups and in the next column what Domain Local Security Groups and Universal Distribution Lists they need to be in.  How could I accomplish this with a...

View Article

Get-FolderACL Filter?

Martin9700 has an awesome script Get-FolderACL for my audit purposes. Thanks Martin!(https://community.spiceworks.com/topic/367228-list-users-with-access-to-specific-folder?page=1)I have a question...

View Article


Powershell - remove-item error

Hi all,I have a list of directories in a CSV file that I am needing to delete. I am using the following...

View Article


The best approach to a collection of variables

You may recall this discussion:https://community.spiceworks.com/topic/1261733-prompt-user-with-choicesHaving (with help!)worked out how to prompt for a choice, what's the best way of using that choice...

View Article

Powershell - OutOfMemoryException

Hi allis there a way i can have powershell allocate more memory to code being executed?Am trying to make a simple zip function based on powershell 5's compress-archive cmndlet but when i try to do this...

View Article

Powershell script to block sites via hosts file

Hello Spicers - I'm wondering if anyone has a powershell script handy that will write to the hosts file to block www.facebook.com AND if possible unblock it. Example - run it once - blocks site - run...

View Article

Functions

How do I make my functions always available to me when I am logged into the ISE?

View Article


Image may be NSFW.
Clik here to view.

PowerShell Sith Lord

I've been making fun of click next admins and a co-worker called me the Automation Sith Lord and I thought it would be cool to create an image for it. Let me introduce you to the PowerShell Sith Lord!...

View Article

I was wanting to add a progress bar to a PADT deployment

I found how to add a progress bar to powershell, but it's just in the shell. Is there a way to bring a progress bar out of the shell and display it with the application deployment status window?for($i...

View Article


Program to email users when a file has been added or modified.

I have seen a few scripts that can monitor a folder for changes and some can email a single user. All these scripts seem to be very old and do not have a lot of features. Is there an actual program...

View Article

Cannot deduct one date from another.

This is simple, I know, but for some reason I am unable to do it.The date gets imported from a csv file and subtracted from the current date to reveal an integer of days...

View Article


Powershell NRPT question - Homework help

I am in the middle of Server 2012 r2 project for my Sys Admin class and I am stuck on a Powershell step so hopefully someone can point me in the right direction here. The project is basically...

View Article

Example of Creating Local User via PowerShell

I am trying to create a PS1 script that will create approx. 2000 local users on a Windows 2012 R2 server.I have tried a few scripts on the web, but I keep setting errors.Does anyone have an example of...

View Article

powershell populate a validate set from script

I waht to streamline a bit of a function with a validate set. Using GShell I can get each of the groups email addresses from the Google email domain as followsPowershell(Get-GAGroup-all).emailWhat I...

View Article
Browsing all 15370 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>