Sign in to join the PowerShell Group
-
Thank you VERY much! Your script will save me a lot of time and effort, and I really appreciate it.
For anyone else reading the comments, upgrading to Powershell v7 and using the SHA1 algorithm for hashing sped up my deduping by a HUGE margin. I think the first time I ran it it took over 7 minutes. But the with Powershell v7 and changing from MD hashing to SHA1 it was down to seconds – approx 30 seconds. That’s a huge improvement in speed.
-
How to set retention time while using write-s3object command in s3 client module?
-
Wolfgang Sommergut commented on
Activate BitLocker with manage-bde, PowerShell, or WMI 1 day, 2 hours ago
You will find the answer to this question in this article.
-
This should work:
Get-ChildItem -Path “C:MyFiles” -Filter *.jpg -File -Recurse `
| Group -Property Length | where { $_.Count -gt 1 } `
| foreach { $_.Group } `
| Out-GridView -Title “Select files to move to R:Dupes” -PassThru `
| Move-Item -Destination “R:Dupes” -Force -Verbose -
This is a great way to find duplicates. However, I have a significant number of small files (over 100,000) that I’m trying to scan. So for them, filesize is a good enough indicator to move them and investigate further. But I can’t seem to modify what you’ve got above to just use filesize. It finds the duplicates, and opens the selection window, but the move command fails because the Path is blank or null. What am I doing wrong?
Here’s my command:
Get-ChildItem -Path “C:MyFiles” -Filter *.jpg -File -Recurse `
| Group -Property Length | where { $_.Count -gt 1 } `
| foreach { $_.Group | select Path, Name, Length } `
| Out-GridView -Title “Select files to move to R:Dupes” -PassThru `
| Move-Item -Destination “R:Dupes” -Force -Verbose -
Is there a powershell command that can be pushed out for force the recovery key to be sync’ed with the computer account in AD? We currently use a script to activate bitlocker, set the PIN, require TPM and then push the recovery key to AD, but previously, it was all manually done and there are computers out in our environment that do not have their recovery keys in AD.
-
Wolfgang Sommergut wrote a new post 2 days, 2 hours ago
Activate BitLocker with manage-bde, PowerShell, or WMI
You can configure various settings for BitLocker using group policies, but this doesn’t initiate encryption. Similarly, it doesn’t create the configured protectors that are necessary for activating BitLocker. Manage-bde, PowerShell, or the WMI class Win32_EncryptableVolume serve this purpose.
-
Sponsor posted an update in the group
PowerShell 4 days, 2 hours ago
Managing Active Directory users and groups is one of the central, recurring tasks of IT administration.
For example, new users and groups have to be created, group memberships have to be managed or reports have to be generated.
In this webinar, we will show you how these tasks can be standardized, automated and delegated in a time-saving manner using PowerShell.
Register for free -
David Figueroa commented on
Export and import to and from Excel with the PowerShell module ImportExcel 6 days, 11 hours ago
Just import them like normal using the -StartRow parameter.
$Excel = Import-Excel -Path c:temptest.xlsx -StartRow 5
-
Neel commented on
Export and import to and from Excel with the PowerShell module ImportExcel 1 week ago
Hi Sir,
Thank you for this tutorial. Please can you help me with deleting first 4 rows in xlsx while importing.
-
It should work just fine. The -ExecutionPolicy Bypass tell it to ignore the ExecutionPolicy. That’s why Microsoft stresses that ExecutionPolicy is -not- a security boundary.
David F.
-
OsyOsu posted an update in the group
PowerShell 1 week, 1 day ago
I would like to know how can notify all my users on my domain that their password will expire after 15 days, does someone knows how get it this issue solved ?
-
The easiest way is through a login script. You can have it read the registry values for expiration, compare it to the current time and then pop up a display or send them an email that their password is going to expire.
You can also put together an automation script that will scour AD for expiration dates, and email the users. You would have that version run as a scheduled task somewhere.
There are tools out there to automate this also, but if it is just simple notification, either of these will take care of it.
David F.
-
-
OsyOsu joined the group
PowerShell 1 week, 1 day ago
-
Michael Pietroforte commented on
Use PowerShell Invoke-Command to run scripts on remote computers 1 week, 2 days ago
Why does the filename start with a hyphen? Is that correct? Try running the script and just print $v on the screens to see if the computer names are processed correctly.
-
Facundo commented on
Use PowerShell Invoke-Command to run scripts on remote computers 1 week, 2 days ago
Hi I think my latest comment didn’t get posted.
If I run it like this I can run it for several computers :Invoke-Command -FilePath D:-facundoStart-Cleanup.ps1 -ComputerName computer1, computer2, computer3, etc
This will run without issue.
But when I try to set it with a variable ($VMs) and foreach and invoke It won’t work.Error:
New-PSSession: A positional parameter cannot be found that accepts argument ‘computername’ -
Facundo commented on
Use PowerShell Invoke-Command to run scripts on remote computers 1 week, 2 days ago
Hi, Yes. I can even run for a couple if I run it like this
Invoke-Command -FilePath D:-facundoStart-Cleanup.ps1 -ComputerName Computer1, Computer2, Computer3, etc.
If I run it like that it will clean all computers after ComputerName without issue.
But when I try to add a variable for bulk computers and, use Invoke and foreach It doesn’t work.Error:
New-PSSession: A positional parameter cannot be found that accepts argument ‘computername’ -
Michael Pietroforte commented on
Use PowerShell Invoke-Command to run scripts on remote computers 1 week, 2 days ago
Does it work if you run Invoke-Command for a single computer?
-
Facundo commented on
Use PowerShell Invoke-Command to run scripts on remote computers 1 week, 2 days ago
Hello. Thank you very much for the article. It is really helpful.
I wanted to ask you something. Perhaps you can help.
I have a ps1 file. A function.
I am trying to make it run against several remote computers. I am trying to use invoke-command to achieve this but it is not working.
This how I am trying to run it. Can you please tell me if this is OK or how you would run it?$VMS= get-content “D:-facundoVMS.txt”
foreach ($V in $VMS) {Invoke-Command -computername $v -FilePath D:-facundoStart-Cleanup.ps1}
-
Thank you for your reply ( 9 Months is not a time!). However you didn’t answer my question. Maybe you intended to answer another thread, and the text just slipped just in here.
I repeat my question: Does this all work, when execution policy is set to AllSigned per GP?
Essence is: do digitally signed PS scripts work with Ansible? -
Hi Brandon,
Thank you for the wonderful insight.
I run ansible playbook and used all the modules like- win_command/shell/powershell or win_mapped_drive to map and unmap . Task runs successfully but it doesn’t map/unpad the drive in the server.
Ansible ver is 2.7.7
WIn ver – 10What are all the other ways to accomplish this task.
Thank you
- Load More