Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

[MOSS 2007 SP1] - Script Powershell import connection

1 réponse
Avatar
Houdini
Bonjour à toutes et à tous,

Dans "User Profiles and Properties --> View Import connection --> Creation
new connection", je souhaiterais automatiser la création de cette connexion
(page Add Connection)

J'ai réussi à scripter l'interrogation du "user profile" et lancer un "Full
import" quand la connexion existe: ok.

Ci-dessous, le script en question:
=================================
# Load Assemblies
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")

# Get Site and servercontext
$site = [Microsoft.SharePoint.SPSite]("http://serveur:85/ssp")
$sctx = [Microsoft.Office.Server.ServerContext]::GetContext($site)

# Get UserProfileConfigManager (UserProfileManager is readonly)
$upcm = [Microsoft.Office.Server.UserProfiles.UserProfileConfigManager]($sctx)

# Get DataSources
$ds = $upcm.GetDataSource()

# Loop through Connections and change the ones which should be changed
$ds.Connections | % {$_.DomainName='xxxxx'}

#Commit changes
$ds.Commit()

# Start Full import (parameter is bool for incremental)
$upcm.StartImport(0)
=======================================

Si vous avez une idée pour créer cette connexion ...
Merci d'avance pour votre aide.
Cordialement,
Houdini

1 réponse

Avatar
Marc Lognoul [MVP]
Bonsoir,

Encore un peu de patience, je posterai bientôt le code correspondant sur le
projet CodePlex dédié à SharEpoint/PowerShell.

--
Marc Lognoul [MCSE, MCTS, MVP]
Heureux celui qui a pu pénétrer les causes secrètes des choses
Happy is the one who could enter the secret causes of things
Blog EN: http://www.marc-antho-etc.net/blog/
Blog FR: http://www.marc-antho-etc.net/blogfr/



"Houdini" wrote in message
news:
Bonjour à toutes et à tous,

Dans "User Profiles and Properties --> View Import connection --> Creation
new connection", je souhaiterais automatiser la création de cette
connexion
(page Add Connection)

J'ai réussi à scripter l'interrogation du "user profile" et lancer un
"Full
import" quand la connexion existe: ok.

Ci-dessous, le script en question:
================================ > # Load Assemblies
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")

# Get Site and servercontext
$site = [Microsoft.SharePoint.SPSite]("http://serveur:85/ssp")
$sctx = [Microsoft.Office.Server.ServerContext]::GetContext($site)

# Get UserProfileConfigManager (UserProfileManager is readonly)
$upcm =
[Microsoft.Office.Server.UserProfiles.UserProfileConfigManager]($sctx)

# Get DataSources
$ds = $upcm.GetDataSource()

# Loop through Connections and change the ones which should be changed
$ds.Connections | % {$_.DomainName='xxxxx'}

#Commit changes
$ds.Commit()

# Start Full import (parameter is bool for incremental)
$upcm.StartImport(0)
====================================== >
Si vous avez une idée pour créer cette connexion ...
Merci d'avance pour votre aide.
Cordialement,
Houdini