Search found 145 matches

by ITEngineer
Mon Oct 29, 2018 7:14 pm
Forum: Windows PowerShell
Topic: Getting the next largest number of the Workstation based on AD object?
Replies: 8
Views: 1304

Re: Getting the next largest number of the Workstation based on AD object?

Why so much code? Just get the computers and the DistinguishedName and extract the information needed. $buttonTPMStatus_Click={ $filters = @( "Name -like 'PROD*'", "Name -like 'TEST*'", "Name -like 'DR*'" ) foreach($filter in $filters){ $computer = Get-ADComputer -Filter $filter | Sort-Object Name ...
by ITEngineer
Mon Oct 29, 2018 6:44 pm
Forum: Windows PowerShell
Topic: Getting the next largest number of the Workstation based on AD object?
Replies: 8
Views: 1304

Re: Getting the next largest number of the Workstation based on AD object?

First get the distinguished name then extract the name and parent container portions. OK, I have managed to modify it like the below: $patterns = 'PROD', 'TEST', 'DR' $CurrentADComputerName = $null $NextADComputerName = $null ForEach ( $prefix in $patterns) { $CurrentADComputerName = Get-ADComputer...
by ITEngineer
Mon Oct 29, 2018 5:33 pm
Forum: Windows PowerShell
Topic: Getting the next largest number of the Workstation based on AD object?
Replies: 8
Views: 1304

Re: Getting the next largest number of the Workstation based on AD object?

jvierra wrote:
Mon Oct 29, 2018 5:18 pm
Get what OU? A computer object does not have an OU property. Everything after the "CN=<name>," is the parent container.
Yes, how to get the CN where the object in $name was mentioned?
$name = Get-AdComputer -Filter "Name -like 'PRDVM*'" | sort name | Select -Expand Name | select -last 1
by ITEngineer
Mon Oct 29, 2018 5:13 pm
Forum: Windows PowerShell
Topic: Getting the next largest number of the Workstation based on AD object?
Replies: 8
Views: 1304

Re: Getting the next largest number of the Workstation based on AD object?

You would have to query for all matching names and then find the one with the highest number. $name = Get-AdComputer -Filter "Name -like 'PRDVM*'" | sort name | Select -Expand Name | select -last 1 Wow that's cool, simple :) Would it be possible to get the OU as well? OU: domain.com/Servers/Product...
by ITEngineer
Mon Oct 29, 2018 7:08 am
Forum: Windows PowerShell
Topic: Getting the next largest number of the Workstation based on AD object?
Replies: 8
Views: 1304

Getting the next largest number of the Workstation based on AD object?

Hi, I need some assistance in the PowerShell scripting, so I can get the next available number of the Workstation based on Active Directory AD computer object. My AD naming convention for computer objects like the below: PRDVM001 PRDVM002 PRDVM003 ... PRDVM055 So how can I get the return from the Po...
by ITEngineer
Thu Sep 27, 2018 7:23 pm
Forum: Windows PowerShell
Topic: PowerShell remoting not working for Exchange mailbox size?
Replies: 1
Views: 537

PowerShell remoting not working for Exchange mailbox size?

Hi All, I'm running the below script from Remoting (Laptop with PowerShell ISE to On-premise Exchange) to get the mailbox size and the permissions, then Export to .CSV file: $DataPath = "C:\mbxresults.csv" $UserMailboxes = Get-Mailbox -ResultSize Unlimited | Where-Object { $_.ObjectClass -notmatch '...
by ITEngineer
Mon Sep 10, 2018 3:43 am
Forum: Windows PowerShell
Topic: Need to help the modify PowerShell for Exchange server formatting to show the Delegates and AccessRights ?
Replies: 0
Views: 1359

Need to help the modify PowerShell for Exchange server formatting to show the Delegates and AccessRights ?

Hi, I need some assistance in modifying the script that is working but needs some reformatting: Script purpose : Export the list of User Mailbox with other people access other than the user itself to the .CSV Delegates column showing too many commas even when the result is empty. AccessRights someho...
by ITEngineer
Sun Sep 02, 2018 11:19 pm
Forum: Windows PowerShell
Topic: Need some help in formatting the Column export result to remove the SMTP: & smtp: ?
Replies: 3
Views: 713

Re: Need some help in formatting the Column export result to remove the SMTP: & smtp: ?

It seems I have shown you how to do this about a half dozen times. You need to take time to analyze your code to understand what it is actually doing. $filter = '-not Enabled -and homeMDB' $properties = @('homeMDB', 'mailNickName', 'mail', 'DisplayName', 'SamAccountName', 'ProxyAddresses') Get-ADUs...
by ITEngineer
Sun Sep 02, 2018 9:15 pm
Forum: Windows PowerShell
Topic: Need some help in formatting the Column export result to remove the SMTP: & smtp: ?
Replies: 3
Views: 713

Need some help in formatting the Column export result to remove the SMTP: & smtp: ?

Hi People, I need some help with the Replace string operation to make sure the result does not contain the SMTP: and smtp: string? The below script export the list of the Disabled AD account with their corresponding Exchange mailbox details: $filter = '(Enabled -eq $false) -and (homeMDB -ne "$null")...
by ITEngineer
Sun Sep 02, 2018 7:18 pm
Forum: Windows PowerShell
Topic: How to combine the PowerShell script to export list of Disabled AD user mailbox with Mailbox size column?
Replies: 2
Views: 683

Re: How to combine the PowerShell script to export list of Disabled AD user mailbox with Mailbox size column?

I can recommend posting in the Exchange forum to learn how to use the Exchange CmdLets and how to work with Shared mailboxes. You could also search for blog posts discussing how to work with shared mailboxes. Example: Get-Mailbox -RecipientTypeDetails SharedMailbox https://www.google.com/search?new...