Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [powershell]

An interactive shell, scripting and programming language, and surrounding environment from Microsoft. Commonly used by system administrators managing Microsoft software (including Windows, Exchange, SharePoint, and cloud services Azure and Office 365), PowerShell is included by default with Windows, and takes over from previous languages such as VB Script.

0
votes
0answers
6 views

PowerShell SQLServer.Management.Smo.Server can't connect

I am trying to use Microsoft.SQLServer.Management.Smo.Server to connect to my MSSQL server but whatever I try it keeps erroring out with "Failed to connect to server .." #Connect and run a command ...
0
votes
1answer
33 views

Delete registry value specific to user and contained in user's hive

Trying to get a script to run across my domain to delete a registry value contained in the user's hive. This is the path it will be located: HKCU:\Software\Microsoft\OfficeCompat\Outlook\...
0
votes
1answer
18 views

PowerShell error message for script to reset krbtgt account password/keys

We're trying to reset our krbtgt password/keys using the PowerShell script provided by Microsoft, obtained from here: https://gallery.technet.microsoft.com/Reset-the-krbtgt-account-581a9e51?ranMID=...
0
votes
1answer
48 views

Count instances of a pattern's match in a real-time log file, in a specific time frame, using PowerShell?

I've to intercept a pattern in a log file and, when this pattern is matched for 5 times in 5 minutes, send an alert... I've wrote this lines, but I'm stuck... I don't know how to handle the time ...
2
votes
1answer
83 views

Using powershell to access values

I want to access value of "PrivateIpAddress" parameter which is inside "IpConfigurations". How can I do that? When I selected "IpConfigurations" ( command1 below), IPConfigurations->Name parameters ...
3
votes
1answer
56 views

How can I grant Dial-In / Network Access Permission to local account via command line?

I am trying to configure a VPN server completely using Powershell. I have completed everything except the last step: Granting a local user account Dial-In / Network Access Permissions so that this ...
-2
votes
1answer
26 views

exchange 2013 delete mails from folder

I wish to delete some error messages from the Syncronizations\conflicts folder of a specific customer. How can I do it using ECP or Powershell (EMS). I have administration rights
1
vote
1answer
14 views

How do I verify that a custom IIS log field exists with PowerShell?

I am deploying a pair of scripts via SCCM to set a wide variety of IIS configuration items - things like default log locations, truncate values, and so on. One of the things I add is a custom log ...
0
votes
0answers
33 views

Export a single entry of the registry

Is this posssible? For example i have a entry with the Name "DefaultProfile" and the Value "test". How can i export only this one entry not the full tree? I was thinking about somethign like reg ...
1
vote
1answer
21 views

Powershell - Cannot remote install software (Cyberduck)

On the remote machine, I copied the .exe file (from my source machine using Copy-Item command) to the temp folder first which was successful. After that, I ran the following Powershell script on my ...
-1
votes
0answers
15 views

How to automate getting status of a RAID volume on AMD (A55) RAID controller in Windows?

We have a PC used as a Windows server. There's a RAID 0 volume set up using built-in controller (AMD A55 chipset). How can we automate getting volume status data? I managed to find rcadm tool, but it ...
0
votes
0answers
11 views

Get-Disk returns HealthStatus “Warning” and OperationalStatus “Other” for Compellent iSCSI volume

We utilize Dell Compellent storage and I'm in the process of developing a script to provision new iSCSI volumes to Windows servers using the Dell PowerShell SDK. I've successfully provisioned a ...
0
votes
1answer
34 views

Exchange 2013 powershell mailbox recovery

I wish to script the procedure to bring the mailbox back from Dumpster. In my normal procedure I do as below '$Dumpster = Get-MailboxServer | Get-Mailboxstatistics' '$Dumpster | ? {$_.DisplayName -...
0
votes
2answers
62 views

How to check if Outlook can connect to Exchange from a script?

Is there any way to check if Outlook can successfully connect to Exchange from Powershell? I would like to schedule that script for logging purposes. After some research, I managed to cook up the ...
1
vote
0answers
24 views

What should I take into consideration when creating AD users in PowerShell?

The current way AD users are created is: The employee determines which department the new hire is assigned A current user from that same OU is copied to create the new user The problem with this ...
0
votes
0answers
36 views

Passing a variable into Salt cmd.script module?

I have a PowerShell script that finds what version of Java is installed by checking the registry but the script has Java hard coded into it and I would like to be able to change it to Adobe, or Google ...
1
vote
1answer
22 views

moving to Online Archive (in-place Archive) with powershell

I'm trying to move the content of one folder in Exchange Online to the 'In-Place Archive'. As I have to do this for different folder for different users I was thinking of doing it with Powershell ...
-1
votes
2answers
66 views

auto moving computer in respective OU, when joined machine in to domain

we want move Computer account automatically in respective Ou when it join Domain i have some Poworshell script but it is use for manual movement "redircmp ou=newcomputerou,dc=domainname,dc=com" so ...
0
votes
0answers
19 views

convert Curl request to Powershell request using Invoke-RestMethod

I am trying to get help on converting my curl request to powershell code. what I am not getting is how to pass the parameter to url in invoke-restmethod call. My curl request: curl --compressed -k -...
0
votes
1answer
19 views

powershell geting email from domain

I'm trying to find a way to getting all email sent by *@domain.com. I'm trying this command Get-MessageTrace -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) | where {$_.senderaddress -like "*@...
0
votes
0answers
9 views

Windows or Skype Management shell witll not open/launch

I have had issues on my SFB Front End server where I am not able to launch SFB Management shell or windows Powershell. I already tried rebooting the server to no avail. I also tried with a different ...
2
votes
0answers
35 views

Why is listing EC2 Disks so painful on Windows?

Awhile ago, I answered a question on StackOverflow: (How to) remotely extend a partition using WMI. On my r5d instances I upgraded to in January, this script stopped working. Recently I tracked down ...
0
votes
0answers
6 views

How to approve non approved source for powershell package manager?

I am designing an easy to use local repository of application for your classroom and teachers in an university using powershell Package Manager. Normally, this is used for chocolatey and Nuget ...
2
votes
2answers
82 views

How can I start Windows Updates on 10 Windows 2016 servers remotely using Powershell

I have 10 domain joined Windows 2016 servers. I need to run Windows updates on them, I don't want to logon on to each of them, and then manually start Windows Updates. I found that you can do it ...
1
vote
1answer
48 views

Compress only files

I would like to make a powershell script using this or the compress-archiev in powershell to make a zip file with only files, not folders. Top folder contaning folders, in subfolders there are folders ...
2
votes
1answer
63 views

What are sockets with bound state on 0.0.0.0

I know a listening socket on 0.0.0.0 is listening on all IPv4 interfaces. But we also see a lot of 'bound' stockets on 0.0.0.0, if we check with Get-NetTCPConnection in powershell. All on high port ...
1
vote
0answers
16 views

How to keep PowerShell process open with input/output on runtime?

I'm researching these days on how to can I keep a powershell process alive so I can run PS code without opening a new process each time. The need: - Running multiple PS scripts dynamically, so they ...
2
votes
1answer
96 views

Check which workstations a Windows domain user is logged into [duplicate]

I'm trying to find out on what workstation the user is loged in at the time. I haven't found a way yet. Is this even possible? I have a username and want to get his current workstation. I have ...
1
vote
0answers
16 views

How to start a process with a subset of user permissions?

Let's assume I have a process a.exe that according to its manual/specification does not write any files, how would I start it without write permission? Closest I can think of is creating a user with ...
0
votes
2answers
47 views

Create Azure Storage Account with Powershell Fails

I'm trying to create a storage account but I get the following error: "New-AzStorageAccount : The resource type 'checkNameAvailability' could not be found in the namespace 'Microsoft.Storage' for ...
0
votes
1answer
23 views

Running Azure AD powershell module from app service

I'm running an App Service from which I would like to run commands from the Azure Active Directory V2 PowerShell module. I haven't found any module to do so and running a module's command result in ...
0
votes
0answers
34 views

sccm and wsus problems

Let me try to explain my problem. I have an offline system (multiple servers virtual and physically) that are provided with updates via SCCM. We get the updates on a regular Basis from a higher up ...
0
votes
0answers
21 views

How do I tell the difference between a self signed ca I made for myself for signing scripts and ones that were already there?

Basically my question is, how do I know when a certificate I find in my cert:/localmachine/my store is self signed and not already present when I start using a new computer. If you do a Get-ChildItem ...
1
vote
1answer
20 views

Powershell - test http with specific adapter - multiple nics

Do you know a way to test if an HTTP server is reachable with a specific nic ? My scenario is the following : our company is using laptop for all our employees. To use the network we can either use ...
-1
votes
1answer
26 views

Office 365/Exchange online - I need a list of all devices that connected to EO in last 90 days

So I need to find information as in the topic. I found that get-mobiledevice is quite OK, but it lacks two major informations for me: UPN of user, who used it and the time, when it was used. I can ...
0
votes
1answer
42 views

Zabbix Discovery JSON values

I have multiple Zabbix agents (Windows agent) and I need to check software license's details on each agent from localhost JSON URL. On each agent we can see license information on local web URL like ...
1
vote
2answers
95 views

Better way to get Microsoft Failover Cluster IP address resource through PowerShell

Is there a better way to view the IP address assigned to cluster IP address resource through PowerShell? Today, I use Get-ClusterResource, but I have to populate the cluster IP address resource name ...
2
votes
0answers
24 views

File locked only for Developer that tries to deploy

Our Developers work with VisualStudio 2017 They use a Post-Build PowerShell function that I wrote, to publish the application to the correct destination. Sometimes (1 out of 100 times) they get the ...
1
vote
3answers
75 views

Delete Local Administrator

Back story real quick: some reason some servers have 2 local admin account... no idea, I took over the job and cleaning everything up. I need to go through 600-ish (or more) servers to delete the ...
1
vote
0answers
83 views

Enable-Bitlocker -TpmProtector via GPO does not work (0x80070522)

I am trying to automate the bitlocker in our corporate environment. I have written a script which enables the bitlocker and it works fine if I run it manually, but whenever I implement it via GPO (...
0
votes
1answer
67 views

WinRM remoting server with local Adminnistrator account not working?

I have a server Windows 2012R2 in the domain. This server has no domain user access, only local admin user. I can RDC into this machine using admin account, but cannot have a PSSession, so Enter-...
1
vote
1answer
61 views

List all MemberOf rights for all user

I am trying to get a list from active directory, where I only see SamAccountName, and all the information from MemberOf tab. The following code lists all the user, but when it comes to MemberOf ...
1
vote
0answers
22 views

Msft_Volume: multiple records for 'D:'

Im getting some strange results for Msft_Volume query Get-WmiObject -Query "SELECT * FROM Msft_Volume" -Namespace Root/Microsoft/Windows/Storage I see 'D' drive six times! I there any explanation ...
0
votes
0answers
11 views

How to change User Information under Canon print properties from command line

Can anyone help me change Printer user information from CMD or powershell. I am using this print driver. The User Name is what I need to change:
5
votes
1answer
63 views

Event Descriptions Missing From Get-EventLog but present in Get-WinEvent and Event Viewer

Many of the event descriptions for event log events are missing when I query them in powershell with Get-EventLog but they are present when I query them in powershell with Get-WinEvent or view them in ...
0
votes
1answer
66 views

Why does the test-connection command does not work and gives the below error

Test-Connection -ComputerName testserver.example.com -Count 1 Test-Connection : Provider load failure At line:1 char:1 + Test-Connection -ComputerName testserver.example.com -Count 1 + ~~~~~~~~~~~~~~~...
1
vote
1answer
32 views

Azure Portal VM ARM Template Deployment With KeyVault

I want to deploy a VM in Azure and store the local admin password in Keyvault. I was wondering if it is possible to do the deployment through the Azure Portal? I've added the required info to my ...
1
vote
1answer
34 views

azure setting variables across subscription contexts

I am trying to powershell script (Az latest) an existing vnet peering configuration using add-azvirtualnetworkpeering. The two vnets are in different subscriptions. It appears I must use a variable ...
0
votes
1answer
44 views

Assign group permissions on folders using Powershell via CSV

we are working on a new Permission Concept. We created different Security Groups,depending on the Department. For example: Finance_List, Finance_Read, Finance_ReadWrite Controlling_List, ...
0
votes
1answer
13 views

[AWS][Systems Manager] Restart instances with Dependency Order

Basic case: Let's say I have 5 instances with 5 different application component on them. When I have to perform a restart of the whole product I need to chain stop/start in a specific order usually ...