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 ArticleGet-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 ArticleRemove 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 ArticleHelp 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 ArticleGetting 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 ArticlePowershell 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 ArticlePowershell 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 ArticlePowershell 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 ArticlePowershell 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 ArticleCount 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 ArticleHow 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 Articlewhenchanged 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 ArticleExtract 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 Articlepowershell 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 ArticleRemove 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 ArticleHow 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 ArticleUsers 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 Articlecheck 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 ArticleStruggling -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