How can I find all of items in the "user / profile" for the current user from a package? IE \\Default\etc..
For example when my package is run I would like to know for the current user all of the items in their "SPAdmin" "User/Group" "user Name" "Profiles" tab. Then I can configure some defaults in the package for them.
Thanks
David
User Profile from a Package
-
- Posts: 411
- Joined: Thu Sep 11, 2008 11:35 am
- Location: Raleigh, NC, USA
- Contact:
Re: User Profile from a Package
The current API does not expose that data. You will need to query the SQL table(s) directly until the public API supports this ability. This is a planned feature of the Boylan release (later this year).
John Morris
Sr. Software Architect
SoftPro
Sr. Software Architect
SoftPro
Re: User Profile from a Package
This is what we ended up with:
WITH ProfileTree(Parent, ID, ProfileName) AS
(
SELECT Parent, ID, cast('\\'+[Name] as varchar(255)) AS ProfileName
FROM dbo.Profile
WHERE Parent IS NULL
UNION ALL
SELECT e.Parent, e.ID, cast(d.ProfileName + '\' + e.[Name] as varchar(255))
FROM dbo.Profile e
INNER JOIN ProfileTree d
ON e.Parent = d.ID
)
SELECT p.id, p.name, d.ProfileName
FROM ProfileTree d
INNER JOIN dbo.profile p
ON d.id = p.id
WHERE LEN(p.profitcenter)>0
ORDER BY ProfileName
WITH ProfileTree(Parent, ID, ProfileName) AS
(
SELECT Parent, ID, cast('\\'+[Name] as varchar(255)) AS ProfileName
FROM dbo.Profile
WHERE Parent IS NULL
UNION ALL
SELECT e.Parent, e.ID, cast(d.ProfileName + '\' + e.[Name] as varchar(255))
FROM dbo.Profile e
INNER JOIN ProfileTree d
ON e.Parent = d.ID
)
SELECT p.id, p.name, d.ProfileName
FROM ProfileTree d
INNER JOIN dbo.profile p
ON d.id = p.id
WHERE LEN(p.profitcenter)>0
ORDER BY ProfileName