How do i create a file that will run something in windows powershell
I have recently found out that typing "wininit", and running it in powershell blue-screens your computer. I was wondering if there was a way to run powershell this by opening a file/running a file, so that I could mess with my friends.
How to pull a list of all groups I do not have permission to modify in Active Directory?
I am a newer desktop admin trying to determine what groups I don't have permission to modify in Active Directory so I can send a list to get permission to access them. Is there a script I can run in PowerShell or a way otherwise to pull a list of such? I…
Is there a way to copy all files from one user's onedrive to another?
We have a user who has 600GB of files in separate folders on one account and is moving to a new account. They need to move all these folders across via OneDrive but I can't find any resource that will make this happen due to the high quantity and size of…
Powershell Script does not send email to the user
Hello, I have the following script. Everything works fine except the part that it is supposed to send the email to the user. The part that send an email to the supervisor is working properly. I took the original form to a website and I edited it myself.…
Get Hyper V Administrators group from PowerShell without knowing the name
hello, I want to make a PowerShell script that can add something (I know how I can add ) in the Hyper V Administrators group without knowing the group name (because I saw that this can be different based on Windows installation language and I want a…
Which role/permission needed?
I've SharePoint Admin role enabled. While executing 'New-PnPTeamsTeam' command I'm getting error. Please advise which role/permission needed to overcome error and how to activate? Write-Host "Connect to Admin centre" Connect-PnPOnline -ClientId…
Stop Service from running on multiple pc's
We have a .net application that is pushed out to multiple pc's around the Unites States. When the user installs this application initially, a service is started. That service is no longer needed. So we'd like to stop it programmatically with the next…
Create a table-like custom object from a variable with CSV content
Hi, I have contents in a variable called $file echo $file gives this Timestamp,Category,OperationName 2022-10-26 19:21:23.5114273,Warning,Insert 2022-10-26 19:21:23.5114273,Warning,Update As you see, the variable is really a CSV. I want to create a…
Error to publish module to private repository
I’m trying to publish a module, which I wrote, to a local repository. The repository is correctly created, if I type get-psrepository I see it. When I launch the command Publish-Module -Path C:\Modules\mymodule -Repository MyRepository the error…
interacting with an API using powershell using an API-KEY
I am wanting to retrive data from an API using powershell Ideally it would work the same way this curl command works , any suggestions? [root@svd-nmrobm01 ~]# curl -d '{"sam_account_name":"smithm"}' -H "Content-Type:…
Your domain controller performance is very critical for that you need to write, test and schedule a PowerShell script called “PerfMonitor.ps1” that runs daily at 10:00 AM and repeats every one hour to chck if there is any process that taking more than
Your domain controller performance is very critical for that you need to write, test and schedule a PowerShell script called “PerfMonitor.ps1” that runs daily at 10:00 AM and repeats every one hour to chck if there is any process that taking more than…
Unable to find custom list template and differentiate custom template list and normal list?
Hi, I have created a list custom template from PowerShell utility (Used script from here [https://learn.microsoft.com/en-us/sharepoint/lists-custom-template). Now I am able to see new custom template in 'From your organization' during list creation…
How to pin/un-pin programs in start menu and starkbar windows 11
Im automating some stuff and would like some help, can anyone help me create or show a working powershell script example that can add or remove pinned programs in the task bar and start menu in windows 11? Im not really versed with powershell, i cant…
Invoke-WsusServerCleanup not finishing
We ran into an issue where our update server would not successfully run cleanup for the "Unused updates and update revisions" and "Unneeded update files" options when running the WSUS Server Cleanup Wizard. It kept giving the…
Invoke ADF pipeline using powershell script
i have run the below code but it does not seems to be. i'm geting below rerror Invoke-AzDataFactoryV2Pipeline : The term 'Invoke-AzDataFactoryV2Pipeline' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the…
Facing: New-ServicePrincipal : The term 'New-ServicePrincipal' is not recognized as the name of a cmdlet, function, script file, or operable program.
Im trying to setup xoauth2 for our helpdesk aplication. Im following below commands to configure exchange. Install-Module -Name ExchangeOnlineManagement Install-Module Microsoft.Graph Install-Module -Name AzureAD import-module AzureAD Import-module…
Powershell backup-sqldatabase -ExpirationDate
Greetings! I'm just having a bad time trying to set the expiration date to a SQL Server backup through powershell SQLSever Module. My need is that the next backup overwrites the current file in the directory. I've Tried to achieve that with: $Expira =…
Microsoft.Data.SqlClient PowerShell
I would like to use the Microsoft.Data.SqlClient namespace/ objects in a PowerShell script. Two (click1, click2) GitHub posts provide a way to load the dll's, but does Microsoft provide any (official) PS module which could be imported? I don't want the…
Find all users assigned to external access policy for teams
Is there a command in powershell to list out all users assigned to a certain CsExternalAccessPolicy?
Using ForEach with If to Check Computer Accounts for Group Memberships
I'm working on a script that checks the members of an OU to see if they are members of a corresponding group. The script currently just adds devices from the OU to the related group. What I want is for the script to check each device in the OU to see if…