Quantcast
Channel: /r/powershell – How to Code .NET
Browsing all 8793 articles
Browse latest View live

PowerSploit – Pentesting with Powershell

submitted by /u/InvisibleTextArea [link] [comments] The post PowerSploit – Pentesting with Powershell appeared first on How to Code .NET.

View Article


ADSI query help needed

Hi! Created my first script in PS using ADSI. Goal: get AD account information based on DisplayName property. The input is a csv file which contains users and the header of interest of course is...

View Article


New guy here; want to extract email adresses from a local folder with bounced...

Hey all, I just got a USB stick with thousands of bounced e-mails, and was asked to retrieve the email adresses of these bounced mails. Can any of you help me retrieve these with a script? submitted...

View Article

Task Scheduler – run a PS function

That’s my rather basic script: function CheckSomeService { $ServiceName = "FooBar" $arrService = Get-Service -Name $ServiceName if ($arrService.Status -ne "Running") { Start-Service $ServiceName } }...

View Article

Get-Printer / foreach help

I have been working on a printer dashboard for work using this script: http://pastebin.com/uxTXdeFD Starting at line 17, it runs through all the printers, and does some stuff. get-printer returns a...

View Article


Service accounts set up with mailbox hosted on O365.

Hey guys, Trying to find the best way to modify our service account function to create mailboxes on O365 by default, as opposed to our on premises Exchange server. http://pastebin.com/NpJvvY3M This is...

View Article

Powershell Copy-Item to remote public desktops

Hello, I am attempting to copy some files off a file share to remote computers from a txt file. I am looking to store these files on the public desktop. I DO NOT have access to GPO and I have a...

View Article

PowerShell equivalent of cURL query?

What would the PowerShell equivalent of this cURL query be? curl -k --user admin:password https://host:9999/host-service/domains -H "Content-Type: application/json" -X GET I’ve tried the following...

View Article


PSA: $env:COMPUTERNAME and hostname are not the same

submitted by /u/conan1989 [link] [comments] The post PSA: $env:COMPUTERNAME and hostname are not the same appeared first on How to Code .NET.

View Article


Find common groups in a set of users

I’m having trouble figuring out how I could take a group of say, 25 users, pull their AD groups, and then compare them and create a list of only the groups shared by all 25 users. I’m doing a foreach...

View Article

Manually running script works fine. Running through Task Scheduler doesn’t.

Weird behaviour. I made a script which checks files in a folder to see if they are older than a certain date, if so, outputs the name of the file in a .txt log file. This works great when right...

View Article

Can’t run scheduledjob from script

I am trying to create a scheduled job at the end of one of my scripts. It is supposed to set up a separate script to run at startup, this is how I’m trying to do it. $t = New-JobTrigger -AtStartup...

View Article

Waiting for an executable to finish running before proceeding.

I recently spent a lot of time trying to figure out how to get my script to wait until an executable was finished before running the rest of it’s code. Because of security policies on the network I...

View Article


How to use powershell to execute a program remotely?

Hi Folks, I am looking to run the following command on multiple computers in my domain. I have googled and found a dozen “possible” things to try and none have so I thought I would ask you all. I need...

View Article

Call Powershell from Javascript function

I am looking to have an onclick function in javascript call a powershell script, and based on what that powershell script does, javascript will go on its way. I can’t find a suitable response from...

View Article


Adding methods to a Powershell Class

I’m experimenting with making my own classes, and I was wondering if anyone knew how to make a method that would evaluate variables stored within the class. I know how to do this in c#, but I can’t...

View Article

Get-ADUser $logonname -ErrorAction SilentlyContinue

I’m looking to silently continue on this portion, not the entire script so therefore I do not want to set $ErrorActionPreference = "SilentlyContinue" Is there a reason why this is still spitting out...

View Article


Location information for a disk drive

I am trying to create a WMI query to find the location for a disk. The problem: In VMware on a guest with multiple drives on multiple controllers, the SCSI BUS and target IDs in Windows do not align...

View Article

Archiving emails in powershell.

Is there a way to auto archive emails in powershell based off of certain parameters? I.E if in inbox and older than x date . Or if it’s within a subfolder of the inbox and from personA@domain.com...

View Article

PowerShell at Target

Hey, y’all! I’m writing a blog post on how we’re using PowerShell at Target. Specifically, I’ve authored a module that we use to troubleshoot our Point-of-Sale systems (registers and servers), and...

View Article
Browsing all 8793 articles
Browse latest View live