I need to modify an AD attribute for all members of an AD group. I can get this to work if the group has only a single member, but any more it fails. So I know I have something wrong. Any help much appreciated.
So used this command to get users of a group:-
$Names = Get-AdGroupMember -identity "TestGroup"
Used this to set their Mobile Phone as testing123,
Set-ADUser $Names -MobilePhone "Testing 123"
Set-ADUser : Cannot convert 'System.Object' to the type 'Microsoft.ActiveDirectory.Management.ADUser' required by parameter 'Identity'. Specified
method is not supported.
At line:1 char:12
+ Set-ADUser $Names -MobilePhone "Testing 123"
+ CategoryInfo : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.ActiveDirectory.Management.Commands.SetADUser
When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
You may do a big step back and start with learning the very fundamentals of PowerShell first. This will save you from a lot of wasted time and frustrations. And it will enable you to understand the help you get in forums like this.
If you know how to read the help this tells you that you can only provide a single ADUser.
You could provide one or more ADPrincipal shown by the  directly after the value name.
Please use your prefered internet search engine to look for examples for tasks like this. It is a very common task and has been asked a lot of times and has been answered a lot of times already.
It is beyond the scope of this or any forum to teach you basic PowerShell.
Thank you for taking the time to give me some good pointers and for assisting me. I have previously tried to get to learn some more of the basics but do struggle with some elements. But of course accept what you are saying. I did some searching for the loop command but couldn’t find anything that really helped in this circumstance.
Are there any particular YouTube videos etc. you would suggest as a good starting point for using Powershell within AD please?
Learning to use PowerShell by applying it to administrative tasks in AD is actually a really good way to apply and develop PowerShell skills. But you need a foundation of knowledge first, Olaf is 100% correct on this. Check out the book, it is exactly what you need to be able to write the scripts you want and need. One of the authors is also in the video series (which is also very good) that Olaf provided a link to.