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

Move Files Based On CSV List

I am someone who is completely ignorant to PowerShell, so I apologize if this is an easy question. I also apologize if this has been asked before, but Reddit’s search failed me. I have a folder with...

View Article


I’m probably way overthinking this

Hey pros, I’m relatively new to PowerShell but I’ve gone through in a month of lunches. I’m trying to figure out how to have the system get all of the physical disks and put only the ones that are...

View Article


Scheduled Task all output to log file

I am playing with task scheduler and have a script that is pretty much just startingstopping services and setting startup types, start-sleep, write-host. I want to log everything that I would see when...

View Article

I’m afraid of nesting foreach loops, so I wrote this cockamamie script to get...

So I need to check a list of computers to see if they have these specific KB’s installed, and I can foreach the comps OK, but I’m pretty sure I have a lot of unnecessary code in here. Is there a way...

View Article

Wrapper for New-CimSession

Hi, I’m currently writing a bunch of tools that require CimSessions. I noticed that I’m creating a new CimSession in each tool, doing my thing, and removing the CimSession. The controller script runs...

View Article


Can anyone please breakdown what is going on in this script?

$node = $appConfig.configuration.connectionStrings.add | Where-Object {$_.name -eq $dbName} $node.connectionString = $updatedConnectionString Where did add come from? What does $_ stand for here? How...

View Article

Need help with a script that moves IIS logs.

I am trying to finish a script which migrates existing IIS Logs to a new folder structure. The server has less than 50 sites hosted on it. The folder path of the existing is W3SVC** where ** is the ID...

View Article

Automation Question

So every week i go into a encryption management software and manually back up 100+ firewalls on the network. Is it possible to automate this task? If so please tell me how. Thanks. submitted by...

View Article


Value of variable disappears after function call

In my script, I have this function call here: Write-Host "About to call generate-password with length as $length" Generate-Password($method, [int]$length, $useSpecialCharacters) In the console window,...

View Article


ConvertFrom-Json/Invoke-RestMethod skips “__type” fields?

Hey there, everyone! I’m trying to write a module to interface with Verdiem/Aptean’s Surveyor web service, and I’m having some issues trying to get data back out of it using its REST/JSON API. From...

View Article

Is there a good way to require one of two modules be present?

I am in the process of writing a module and I’ve hit a bit of a roadblock. Not all of the intended audience will be on Windows and there is a different version of a module I need in .NetCore. As far...

View Article

What have you done with PowerShell this month? June 2017

What have you done with PowerShell this month? Did you learn something? Write something fun? Solve a problem? Be sure to share, you might help out a fellow PowerSheller, or convert someone over to the...

View Article

POWERSHELL CONVERT EXCEL TO DSC (DESIRED STATE CONFIGURATION) CONFIGURATION...

submitted by /u/kunaludapi [link] [comments] The post POWERSHELL CONVERT EXCEL TO DSC (DESIRED STATE CONFIGURATION) CONFIGURATION HASHTABLE FORMAT appeared first on How to Code .NET.

View Article


PS script to disable AD object and remove user Memberships

Hello,, ive recently got into AutoIT and automating functions. For some odd reason I cannot get AutoIT to play well with AD so im moving over to powershell. One of my tasks is disabling an AD user and...

View Article

Has anyone written a proper PowerShell wrapper for Joe Richards’ ADFind Tool?

Genuinely curious. If truly none exists and there’s interest here, I can write one. Thanks! submitted by /u/challer [link] [comments] The post Has anyone written a proper PowerShell wrapper for Joe...

View Article


Small guide to make web API calls to McAfee ePO using Powershell and...

How to: Find your ID certificate’s thumbprint in ActivClient (note its first 4 characters) Open Powershell Type “LS Cert:CurrentUserMy” Copy the string that represents your ID certificate thumbprint...

View Article

Import-Csv and return values based on value in other cell

Please forgive me, as I’m quite new to powershell scripting. I’m attempting to parse a csv and output IP addresses to a text file. Example of the data I have in a csv:...

View Article


Looking for multiple possible folder paths to copy to new destination.

I’m writing a script to copy users off our old (VERY OLD) file server to a new one that will have their my documents folder created by GPO. The problem is, the old server is 14 years old and the users...

View Article

What PS Version is needed to run my script?

Hi everyone, I made a few scripts over the past few months, and realized today a few of them require a certain version of PS to run. Is there a way to test a script to know which version is needed to...

View Article

Getting logon/logoff logs for a remote computer: not all events are being...

I’m using this script: https://github.com/pdxcat/Get-LogonHistory/blob/master/Get-LogonHistory.ps1 While it works, I’m getting a bunch of logon events back-to-back but no logoff events in between. So...

View Article
Browsing all 8793 articles
Browse latest View live