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

Join a string with inconsistent spaces

Hi guys, I'm getting content from text file using Get-Content, I'm currently stuck, I want to turn the output into csvHere is one line of my content that I need to join it with semicolon. Thank you cls...

View Article


how to - script to *move* a file from local drive to shared or mapped drive ?

this seems like a simple concept but i'm having trouble doing this.preferably I'd like to use move-item so i don't have to delete the source file.but do i have to somehow tell powershell that this is a...

View Article


Sending Individual Attachments to a List of Email Addresses In CSV using...

Hello geeks, From a application daily reports are created for each customer in a directory. I need to send email to the customer with the pdf report as an attachment as per schedule in the evening 6PM....

View Article

Altering cluster share permissions - Error status 2310 (this shared resource...

Hi everyone,I'm desperately after some assistance with a Powershell script. Following the necessity to implement anti-ransomware measures, we now have a script designed to set all share permissions to...

View Article

Check if string contains invalid characters

Hi, How can I check if a string contains anything other than alphanumeric characters and spaces?Like if the string contains any invalid characters it returns True, else it returns false. CheersLasse

View Article


Create a Windows profile to run Powershell script

HelloI need to create a Windows profile to run Powershell script on a Scom management serverHow can i do that?Do i need first to logon to the server with the account if whant to create the window...

View Article

getting vendor specific Printer Driver information

Hey Team I have been tasked with getting the vendor specific Driver information. I thought that this task was going to be easy but it has been a nightmare for me.  So within HP Universal Printer Driver...

View Article

lastLogonTimestamp: How to return true NULL instead of those 01.01.1601...

Hello all, can you please help to change the script to return true NULL instead of those 01.01.1601 4:00:00 for users who never logged in?I assume it can be done via using some IF check.The script that...

View Article


PSRemoting allows unauthorized access on wokrgroup PCs sharing same...

I have a workgroup of Windows 7/10 machines that all have the same username/password. If I Enable-PSRemoting on Comupter-1 for instance, it sets LocalAccountTokenFilterPolicy to 1. Now with remote UAC...

View Article


Exception of type...

Hello, I have this error when i try to run my .net application who connect to O365 and get user information:Exception of type 'Microsoft.Online.Administration.Automation.MicrosoftOnlineException' was...

View Article

Need any user who is using IE 10 and lower.

This is what runs now at login to show us usernames, computer names, version, etc. We really need a complete list of any users that are using IE10 and under and not show who is using IE11. Can this be...

View Article

Remove-PSSession is Very Slow.

Hi all,I'm looking for an absolute minimum configuration for a remote PowerShell session to another server on our network. My issue actually is that 'Remove-PSSession' is very slow to complete. I've...

View Article

Using PowerShell I get error "Unable to find type"...

Hi PowerShell Scripters !In the function below the following Line $CsvFileFormat = [Microsoft.Office.Interop.Excel.XlFileFormat]::xlCSVWindowsCauses the following error:[ERROR] Unable to find type...

View Article


(SO) How to parse a TXT file, linking each 2 lines in a dictionary?

from SO: http://bit.ly/2hgUvO4In file:    act     12    sat     34     cle    45    act    78The result ( dictionary ) should be ( duplicates must be ignored ):    act  12    sat  34    cle  45▪

View Article

Setting Public folder rights from CSV file fails on multivalued rights attribute

So I have exported public folder client permissions from a source structure to a csv file with three columns. "Folder", "User" and "Rights".  I want to set the permissions again from this csv.  The...

View Article


getting my output a certain way

I have the following code which works.   It prompts you for a code. This code is part of the AD Computer Description field.   It will then query AD and find all the machines that have$code in their...

View Article

(SO) Extract different rows from 2 text files: Simple! Just 'diff' them.

From SO: http://bit.ly/2hxSOJpThe OP over there has 2 files and want the different rows written to a 3rd file.Simple:diff (gc $file1) (gc $file2) -passthru | sc $file3▪

View Article


Split an array of string and flatten into single array

I have a following array of strings$array = @("asdf asdf","aaa ddd","cccc a","aaaa dd")and I would like to split every element of that array by a new line and put the result into  arraySo expected...

View Article

Why can I set ownership with icals but not with set-acl On 2K12R2?

Why using get-acl -Path 'C:\Program Files' | set-acl -Path 'D:\Program Files' as an administrator tells me I am not allowed to set the ownership while using icACLs"C:\Program Files" /save Perms.txt...

View Article

Pull All User Attributes with PowerShell

Okay, when I go into ADUC and open up the Attribute Editor for a User I see something like 300 attributes. Many are blank or unused, that's fine. I need to pull that full list with Powershell. I don't...

View Article
Browsing all 21975 articles
Browse latest View live


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