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

Cannot call a method on a null-valued expression.

HiFirstly, apologies if this is a basic one, i am new to Powershell so still learning.I am trying to change a local admin password across the estate using powershell with the below script, however when...

View Article


RDWEB - How do I display a \ on the home page?

I am trying to add text to RDWEB home page. I can't get the \ to display. I want to give the example of logging in as moa\peisenberg but this display as moapeisenbergWhat do I add to below command line...

View Article


How do I stop searching in a Foreach loop after my condition is found?

Hi,The goal is for each user in a list ($AllUsers) to search if a Mail attribute is already set on another user acct's UserPincipalName ($Upn) in the directory, and if found, set a flag and go to the...

View Article

GC -Readline issue

I have a 1 GB txt file with 100000's of lines of SQL insert Cmdswhich i am trying to execute into a SQL DB.As the file is so big and uses 13gb of memory to process all in one go and normally has lots...

View Article

GPO - (Logon) powershell script - Not executing

Hi everybody,So I setup a logon script to map some network drives depending on the group membership of a user:$user = $env:username # Get-ADUser $user -Properties * (Get-ADUser $user -Properties...

View Article


Execution Policy on Windows 7 Clients for PowerShell Startup Script

I need to deploy a Powershell script via GPO and I'm wondering if I need to change the Execution Policy on all our clients before the script will run. Seems like I should have to but I'm new at...

View Article

Powershell V4 issue with Get-Counter

Hello,Is there a workaround to use get-counter with both the -ComputerName and -Counter switches?  Here is an example:$server = 'MyServer'get-counter -ComputerName $serverReturns a resultget-counter...

View Article

Excluding files for extension with Powershell

Hello Dear, I need a help! I have a Fileserver windows server 2008 r2 and I want to execute a script that exclude all files that to finish with *.exe in all directories. I am using a following:...

View Article


Script is not working when in a scheduled task

Hi Guys,I have wrote a script to verify if there's a specific user logged on a specific server and send an email in case he's not. Its working fine testing in a powershell shell, but when I put into a...

View Article


Get-Command then Execute - is this possible?

HiBit of an interesting one, and not sure what term to "bing" to get answer, so hoping someone here has the answer :)So in the middle of writing a script. What I want to achieve is to get all commands...

View Article

Convert a value in powershell

Hello all,I'm quite new in powershell, and here is what I want to do : I want to populate and AD group dynamically but without having to empty the group each time (Add-ADGroupMember send an error when...

View Article

Convert a text file to html

hi, i have a text file with data in it without column headers, how can i add that and convert to html

View Article

Get-mailbox parameters to target security and distribution groups

I'm trying to use a handy command in powershell that will delete existing email signatures in O365.  However, I can't figure out how to use "get-mailbox" command to target a particular distribution or...

View Article


PSEXEC - How Do I Query A Website

In the article named PowerShell Snap-in: Creating Web-Sites, Web applications, Virtual Directories and Application Pools, there is an explanation of how you can download the contents of a specific...

View Article

Running a Macro stored in xltm file on a xls file in PowerShell script....

Hi Experts,I am running a macro "FormatMacro" stored in FormatTemplate.xltm and I want to run it on a xls file.It is working fine from command prompt but Task Schedule is searching xltm file in...

View Article


Deleting computer from AD

Hello,So I know the task seems simple, and it is except when I have the wrong name as input. This is what I am doing:Read a text file with fake and real AD objects using powershell (Code...

View Article

Compare item lastwritetime

Hi everyone,Im doing a backup of a certain set of files and I want to create a powershell script which compares the lastwritetime from the backupfile with the lastwritetime of the originalfile. that...

View Article


Create a Master Powershell server (have all, do all)

Hello all, Could some one help point me in the right direction.  I'm looking to create a master powershell server, one that can do everything in Active Directory, Exchange, SQL, SharePoint, IIS, OS...

View Article

Add-ClusterResource "Client Access Point"

Dear, People-Who-Are-Smarter-Than-Me,I have the requirements to remove/add Client Access Points to a cluster group at certain points during the year when testing different IP connectivity to a sql...

View Article

Does a Break in an If statement in Foreach Loop reset pointer back to...

Hi,For a list of Users, I want to 'exclude' a user from further processing if they occur in the Exclude List.  I do a Break in an IF in the Foreach loop as shown below.  When a Break occurs in either...

View Article
Browsing all 21975 articles
Browse latest View live


Latest Images

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