New answers tagged

0

The issue was in an old windowspowershell provider. The fix is documented here.


0

The puppetlabs-powershell module has a short example in the readme on how to use PowerShell6/7 instead of 5.1 by using the pwsh provider instead of the powershell provider: https://github.com/puppetlabs/puppetlabs-powershell#requirements To use the pwsh provider, change the provider line to pwsh and set the path if your pwsh install is not on PATH. exec { '...


0

Modify sshd config (C:\ProgramData\ssh\sshd_config) Comment out these rows (should be the last couple of lines of sshd_config) #Match Group administrators # AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys After this add your public key to __HOME__/.ssh/authorized_keys as usual.


2

There are things you can do in PowerShell to effectively secure data on your disk, depending on your need to erase/dispose/recycle a drive. Unfortunately there is no easy Erase-Disk -Secure cmdlet. The ATA "SECURE ERASE" and "SANITIZE" commands can be sent to the storage device controller and are usually your best technological bet for ...


0

I had the same issues os the OP and due to a heavily locked-down environment, I am unable to change the PS Execution Policy, and moving my whole profile from a DFS network share was not an option, but I need a $Profile. The profile is read from several places, discovered by: $profile | select * It should return the locations of your profiles, relative to ...


0

Check out this thread: https://www.reddit.com/r/PowerShell/comments/4ne58u/invokewebrequest_statuscode_always_returning_200/ and answers of this question: https://stackoverflow.com/questions/20259251/powershell-script-to-check-the-status-of-a-url


0

You need to increase the page size to return all the results. 2147483647 is the maximum, you can probably reduce it to a much lower number to get what you need. You can try this sample Get-ADUser -Filter * -SearchBase "OU=AllUsers,DC=example,DC=com" -Properties * -resultpagesize 2147483647 | Select-Object name, DisplayName, DistinguishedName, ...


0

Try specifying -ResultSetSize on Get-ADUser with $null or a value large enough to return all of the results.


1

This is because you are using Kerberos authentication, and you try to perform a "double hop", and this is not possible by default with Kerberos (basically, you can authenticate to "myserver", but you can't "hop" again to "fileserver"). What you can do: Copy the file locally on the server, and then remotely install the ...


0

I had the same question recently. I used below code get-printer -computername targetpc | where-object{$_.devicetype -eq "print"} I hope it helps


2

Make sure that you have enabled UnsafeUserParameters in Zabbix Agent config file. https://www.zabbix.com/documentation/current/manual/appendix/config/zabbix_agentd


0

Reliable fix for this is to make a scheduled task on target servers which will run powershell.exe with arguments like this: -ExecutionPolicy ByPass -Command "c:\scripts\myscript.ps1" param1 param2 set the task to "run with highest privileges" and as SYSTEM if you don't require script to access network. If yes you will probably have to ...


0

This sounds like a memory leak that needs to be diagnosed/resolved by updating the offending software. Until then, you can try a few things to keep it under control. If you have identified the source of the problem, you can set up a scheduled task running as SYSTEM to terminate/restart the problematic process/service at intervals/times that will have the ...


1

Considering that the GetKey method of that class returns an object of the same class, I don't think you can query it in this way. What you are effectively doing is getting an instance of every single key in the entire registry of the local computer. This site claims that number would be in the millions. Perhaps you want to try Invoke-WmiMethod -Namespace ...


1

You have a " instead of ' in your command line. Change it to this: -noexit -NoProfile -ExecutionPolicy Bypass -command "& 'C:\Program File(x86)\WinSCP\WinSCP' /ini-nul/script=C:\Users\Glen\Desktop\WinSCP\Downloadscript.txt" The winscp parameters seem to be incorrect as well. I assume /ini-nul/script=... should be /ini=nul /script=...


0

This message is repeatable if your "-TargetPath" is incorrect, make the system give it to you. $OU = (Get-ADOrganizationalUnit -Filter "name -like '[OUName]'").DistinguishedName Get-ADComputer [ComputerName] | Move-ADObject -TargetPath $OU


1

The character encoding used by powershell is UTF-16LE. So if you're encoding your string from a Linux based OS, you can use iconv to make the output compatible with powershell: $ printf 'whoami' | iconv -t UTF-16LE | base64 dwBoAG8AYQBtAGkA $ powershell -EncodedCommand 'dwBoAG8AYQBtAGkA' user1


3

You can't join a Domain Controller to a different Active Directory domain. The whole Raison d'ĂȘtre of a DC is managing a domain, it's simply not possible to remove it from the domain it manages and/or join it to a different one. This is so critical for a DC that if AD services can't start properly, the server will simply blue screen. In order to be able to ...


Top 50 recent answers are included