Excel-powershell
2 TopicsScript to get AD group and members details but group name is to long
Hi, I found this script on the internet and it works but i have a problem when the group name is longer then 31 charaters. Is there away to rename these groups are to shorten them. This is the script. $result = Get-ADGroup -Properties Name -SearchBase "DC=Contac,DC=local" -Filter * | ForEach-Object { $group = $_.Name Get-ADGroupMember -Identity $group -Recursive | Where-Object {$_.objectClass -eq 'user'} | Get-ADUser -Properties Displayname,Name,EmailAddress | Select-Object @{Name = 'Group'; Expression = {$group}}, Displayname,Name,EmailAddress $result | Group-Object -Property Group | ForEach-Object { $group = $_.Name $_.Group | Select-Object * -ExcludeProperty Group | # save as separate csv files # Export-Csv -Path "C:\tmp\$group.csv" -NoTypeInformation # or as separate worksheets in an Excel document Export-Excel -Path 'C:\temp\XXXX-2023.xlsx' -WorkSheetname $group -AutoSize -title "ADGroup: $group" -TitleBold } }1KViews0likes2Commentspowershell script to copy duplicate rows in one excel file to another excel file
How find duplicate Values In Excel and Export Rows to another sheet using PowerShell. I had an excel sheet with multiple rows and column lets say from A to K. I need to find duplicate rows only if values in all the columns in a row are unique. And the script should ignore D,E,F columns even though those column's values are same. The script should also copy all those duplicate rows and should paste in a new excel file. Also attaching a sample image of input file. Can any one help me on this. Thanks in advance. Note: I don't need unique rows I need only duplicate rows as an output and the output should also contain source duplicated row.i need output as 2 to 7 in this scenario(picture attached). the original file has 1lac rows like this. This attached one is just reference file3.3KViews0likes1Comment