I've managed to import user profiles from our AD. Now I want to add all the imported user profiles into a specific SharePoint group, let's say Visitors, and doing this by using the People Picker takes ages. So I was wondering if there was a way of doing this by using Powershell? It would also be nice if the script could run like once a day so that any newly imported user profiles would get added to the group aswell, this can be done thru a timer job right?
I ran the script again after editing
$User = $OpenWeb.Users to
$User = $OpenWeb.SiteUsers (before that I only got one profile and that was the one was I was logged in as) and this time it semi-worked but the only users that was added to the group were users already added to other groups, not all the users from the user profile database (I'm guessing from the SyncDB?). I can find them if I search for specific profiles in CA -> Manage Service Applications -> User Profile Service Application -> Manage User Profiles, so I know that they are there. Do I have to edit the script in some way in order to get the profiles from the SyncDB (which is where I'm guessing that they are stored)?