Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

Script to Get DNS configuration of Remote Windows servers

Hi,I am writing a Script in PowerShell, to obtain the DNS Configurations of remote Windows servers.I am reading the server name from a text file.I want to use the NetIPConfiguration command in the...

View Article


Placing this code in a scriptblock

Hi All.I am trying to place the code below in a sriptblock, not sure about the format.$root_drive = "D" New-Partition -DiskNumber 1 -DriveLetter $root_drive -Size 20GB Format-Volume -DriveLetter...

View Article


Getting multiple lines between two strings

Hi Experts,I am stuck in a code, my requirement is to get the lines between two strings, please suggest a regex patternInput: Device Name: test Status: Completed Results: [PUSH_TERMLET] Action...

View Article

Image may be NSFW.
Clik here to view.

install-windowsfeature error

hello,i am getting the following error at a dc:anyone who can tell me what i am doing wrong?

View Article

how to get the time diffrence from givn times in file

I have file with below data, I want to get the highest time difference from this using PowerShell.STARTTIME:2018-12-01 04:13:15 ENDTIME:2018-12-01 04:17:15 -----------------------...

View Article


Edit Administrators local group of a remote PC

I'm trying to make a script to edit the Administrators local group of an arbitrary remote PC. The user will usually have rights to the remote PC via their current credentials but not always - sometimes...

View Article

how to delete cached ssh host keys from registry with powershell

I need help with deleting cached ssh host keys for a specific target from the registry with PowerShell.I tried finding the required key with this commandGet-ItemProperty...

View Article

Update/add personalTitle attribute to all users

Hi,I am looking for script that adds or update personalTitle to all users/Thank's for your assist

View Article


How to identify which powershell process is which script?

We need to monitor some powershell scripts running in the background with Nagios (CheckMK).Since at least 10 powershell scripts are running we need a solution to know which process is started by which...

View Article


Native command error when calling via relative directory path

Hi,I am running a command which will export the local group policy and will then import the Group Policy (created on a Domain) on a workgroup computer. I am running this command on a workgroup...

View Article

append multiple wmi queries export csv

Hello I am trying to query wmi data and export it to a csv, how ever I cant seem to get multiple wmi data to append to the same file. I don't know why you cant chain the command.$computers =...

View Article

Script to get list all users and nested users from a list of groups to csv

Hi,I'm trying to get a script to help with auditing our security groups. The script to get all the users and users from nested groups and output it to a csv. Also i need the output to include security...

View Article

Script to get Registry key value from all server in AD and output to csv

Hi,I'm looking for some help with a script to get a csv output of a registry value from all of our servers in AD. The script below is good but it does work properly if the registry value or key does...

View Article


Access database calls require different locking method if called from module

I struggled with this and found a work-around, but would like to understand what is behind it.While building a set of functions to add/change/delete records in an Access database, all was well while...

View Article

Need a quick way to delete a large amount of empty rows in xlsx file

Hi everyone, I need a function that will allow me to quickly clean up the empty rows in an xlsx. I currently have a function that does the job, but does so incredibly slowly considering there are over...

View Article


Wait for remote action, then continue?

Fairly new to PowerShell...I am trying to automate as much of the upgrade process as I can for a fairly complex application that spans across many servers. I'm not sure what I want to do is possible,...

View Article

How to split a loop

Hi,I have got this working as I need from a list file. But I want this to run as a startup script on any machine. I am stuck with how to remove the ForEach Computer from list loop. How do I remove this...

View Article


Getting errors when running shell explorer Share command

Hello everyone, I am trying to integrate some windows features into my node application. I am getting an error however. My code is as follows: $shell = new-object -com "Shell.Application"; $folder =...

View Article

Get All users from multiple AD Group Members

I need to get a list that shows all the users associated with a set of group members.So if I have a security group for example>TOP-Group And TOP-GROUP has 3 other member groups.  1-GRoup, 2-Group,...

View Article

search multiple strings in MS word files, MS excel files and in pdf files

I am trying to make a script that can find multiple strings in lots of files.I have copied and altered the following script for my needs. It does only the MS word files.How can I achieve the same for...

View Article
Browsing all 21975 articles
Browse latest View live


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