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

Image may be NSFW.
Clik here to view.

About Get the last logon time and last boot time Problem for AD domain

Hi Friend,My script : $tp_pcs = get-adcomputer -filter * -searchbase "ou=xx,ou=xx,dc=ap,dc=xxxx,dc=com" -Properties name,lastlogondate $tp_pcs2 = Get-CimInstance -ClassName win32_operatingsystem...

View Article


Get-ACL error handling

import-csv "SOME_PATH" | %{Get-Acl -Path $_.Path | Select path -expand Access |`Where-Object {(($_.IdentityReference -like "*SOMETEXT*" -OR $_.IdentityReference -like "*SOME_TEXT*" -AND...

View Article


Remove all Windows 10 Store Apps

Hi, Not familiar with Power Shell at all. However, I use this script after a clean Windows 10 setup to remove all Windows apps except Store. Please advise how can I add "App Installer"...

View Article

Help in upgrading the Powershell on our Windows 2012 Server

Currently the server has PowerShell v3. I'm trying to upgrade it to v5.1 or even v4.0 and was not able to successfully do so. I'm required to upgrade by the O365 support team that was helping me. He...

View Article

Getting value of specific property when there are multiple results in the output

Hello.  I am trying to get the value in the "IsDefault" for the "MethodType" of PhoneAppNotification. I am using the two line code below... Text$User = Get-MSolUser -UserPrincipalName name@domain.com...

View Article


Powershell File template

Hi Experts,Could you please suggest a better approach for the below requirement.RequirementRetrieve data from SQL Server table which contains1. Execution Frequency2. SQL Query stored inside column...

View Article

Powershell script for updating user data in AD

Hello guys,Could you please help me in getting the powershell script to update users data(i.e first name, last name, job title) inActive Directory in a bulk manner.Regards,Upendra V.

View Article

Powershell script delete folder and subfolder with match filename in another...

I have a folder E:\test\ with many subfolders: folder1, folder2, folder3I have a list.txt file with text: folder2Now, i want a script PowerShell to delete subfolder with filename in the list.txt...

View Article


Powershell script using invoke-command and try\catch for missing registry values

I am looking for the proper PS script to execute on remote servers to check registry values. If I run the following script locally on a reg value not present, I get the correct error message returned...

View Article


Count Occurrences of Specific String in Word Documents

I would like to preface this entire post with a clear disclaimer: I have no idea what I'm doing. I've donevery minimal PowerShell before, would like to learn more, but have no idea how to go about it....

View Article

How to execute a non powershell command with multiple arguments from within...

Hi thereI am running the below powershell code to execute a splunk command in order to reindex 1000's of exchange POP and IMap logs which were parsed incorrectly - and need the splunk indexer to...

View Article

whenchanged attribute in ad using powershell

Hello,I have two users in a specific OU in AD , I need to use powershell script to write "first when those users come to this OU, then if those users have been more than 6 monthes in this OU remove...

View Article

[ADSI]("LDAP://CN=Users,DC=domain,DC=com") suddenly failing when executing on...

Our org is using a PS script to temporarily elevate users permissions when performing certain tasks, the script and the account which executes the script resides in Domain A but can elevate access in...

View Article


Extract Emails(Inbox and its Sub folders) from Office 365 Exchange online

Hi,I need to extract Emails Information like Email Subject, Body, SentOn from Inbox and its sub folders from a shared Email box which is hosted on Office 365 Exchange online using Powershell.Could you...

View Article

powershell loop ip's in curl

Hi,Having a little issue.need to loop ip's listed in a text file into curl.tried but failed here:$d = "C:\Users\Administrator\Desktop\test.txt"Get-Content $d |    ForEach-Object{        Invoke-Command...

View Article


Remove user from AD

Hi Experts,I got a windows server (X) where I have full admin rights to execute commands. I got AD Server IP (Y), username and password.How can I execute commands on server X to delete the user from...

View Article

How to get ADUsers ObjectGUID as hexadecimal format using powershell

Unable to get OjectGUID in hexadecimal with using get-aduser.I'm able to covert with using LDAP query, but i have multiple account. So it would be great if anyone help to get or convert ObjectGUID with...

View Article


Users access on Resources, Resource Group, Subscription in Azure get powershell

I have Subscription where lots of Resources and Resource group created, i want to list all user access and what type for access level user has like Owner contributor rider through the Powershell i have...

View Article

check Windows Event Logs

Hi , could you help me with script I need to take event log only today, I try to do that : get-winevent -logname "Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational" -After...

View Article

Image may be NSFW.
Clik here to view.

Struggling -ExpandProperty to Export-csv

All,I'm learning PS and struggle on formatting when using -expandproperty.  I need assistance or guidance please. I am trying to Export-Csv below information. If you noticed the Hostname1 and Hostname2...

View Article
Browsing all 21975 articles
Browse latest View live


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