Showing posts with label group. Show all posts
Showing posts with label group. Show all posts

Tuesday, March 27, 2012

Check OS Users

Hello,
i need to get information about users that belong to the local
administrators operating system group.
I execute the following procedure and got my information:
exec master..xp_cmdshell 'net localgroup administrators'
The question is that i need to get this information without the NULLs and
the output lines that appear.
Is it possible? Is there any other way to get the same information?
Thanks and best regards.
You can also try using the following in query analyzer if
the builtin\administrators group hasn't been removed:
exec master..xp_logininfo 'BUILTIN\Administrators',
'MEMBERS'
-Sue
On Wed, 9 Mar 2005 05:09:06 -0800, "CC&JM"
<CCJM@.discussions.microsoft.com> wrote:

>Hello,
>i need to get information about users that belong to the local
>administrators operating system group.
>I execute the following procedure and got my information:
>exec master..xp_cmdshell 'net localgroup administrators'
>The question is that i need to get this information without the NULLs and
>the output lines that appear.
>Is it possible? Is there any other way to get the same information?
>Thanks and best regards.
|||> The question is that i need to get this information without the NULLs and
> the output lines that appear.
> Is it possible?
You can use INSERT ... EXEC to insert the results into a table and filter as
needed:
CREATE TABLE #Results(OutputLine varchar(8000))
INSERT INTO #Results
EXEC master..xp_cmdshell 'net localgroup administrators'
SELECT *
FROM #Results
WHERE OutputLine IS NOT NULL AND
OutputLine NOT LIKE '-%' AND
OutputLine <> 'The command completed successfully.'
DROP TABLE #Results

> Is there any other way to get the same information?
Consider using application code rather than Transact-SQL. API's like WMI
are much more robust for this sort of thing.
Hope this helps.
Dan Guzman
SQL Server MVP
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:0DEE4267-7967-4552-8F42-7A8E0E6BCCD6@.microsoft.com...
> Hello,
> i need to get information about users that belong to the local
> administrators operating system group.
> I execute the following procedure and got my information:
> exec master..xp_cmdshell 'net localgroup administrators'
> The question is that i need to get this information without the NULLs and
> the output lines that appear.
> Is it possible? Is there any other way to get the same information?
> Thanks and best regards.
|||Thanks Sue,
Best regards.
"Sue Hoegemeier" wrote:

> You can also try using the following in query analyzer if
> the builtin\administrators group hasn't been removed:
> exec master..xp_logininfo 'BUILTIN\Administrators',
> 'MEMBERS'
> -Sue
> On Wed, 9 Mar 2005 05:09:06 -0800, "CC&JM"
> <CCJM@.discussions.microsoft.com> wrote:
>
>

Check OS Users

Hello,
i need to get information about users that belong to the local
administrators operating system group.
I execute the following procedure and got my information:
exec master..xp_cmdshell 'net localgroup administrators'
The question is that i need to get this information without the NULLs and
the output lines that appear.
Is it possible? Is there any other way to get the same information?
Thanks and best regards.You can also try using the following in query analyzer if
the builtin\administrators group hasn't been removed:
exec master..xp_logininfo 'BUILTIN\Administrators',
'MEMBERS'
-Sue
On Wed, 9 Mar 2005 05:09:06 -0800, "CC&JM"
<CCJM@.discussions.microsoft.com> wrote:
>Hello,
>i need to get information about users that belong to the local
>administrators operating system group.
>I execute the following procedure and got my information:
>exec master..xp_cmdshell 'net localgroup administrators'
>The question is that i need to get this information without the NULLs and
>the output lines that appear.
>Is it possible? Is there any other way to get the same information?
>Thanks and best regards.|||> The question is that i need to get this information without the NULLs and
> the output lines that appear.
> Is it possible?
You can use INSERT ... EXEC to insert the results into a table and filter as
needed:
CREATE TABLE #Results(OutputLine varchar(8000))
INSERT INTO #Results
EXEC master..xp_cmdshell 'net localgroup administrators'
SELECT *
FROM #Results
WHERE OutputLine IS NOT NULL AND
OutputLine NOT LIKE '-%' AND
OutputLine <> 'The command completed successfully.'
DROP TABLE #Results
> Is there any other way to get the same information?
Consider using application code rather than Transact-SQL. API's like WMI
are much more robust for this sort of thing.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:0DEE4267-7967-4552-8F42-7A8E0E6BCCD6@.microsoft.com...
> Hello,
> i need to get information about users that belong to the local
> administrators operating system group.
> I execute the following procedure and got my information:
> exec master..xp_cmdshell 'net localgroup administrators'
> The question is that i need to get this information without the NULLs and
> the output lines that appear.
> Is it possible? Is there any other way to get the same information?
> Thanks and best regards.|||Thanks Sue,
Best regards.
"Sue Hoegemeier" wrote:
> You can also try using the following in query analyzer if
> the builtin\administrators group hasn't been removed:
> exec master..xp_logininfo 'BUILTIN\Administrators',
> 'MEMBERS'
> -Sue
> On Wed, 9 Mar 2005 05:09:06 -0800, "CC&JM"
> <CCJM@.discussions.microsoft.com> wrote:
> >Hello,
> >
> >i need to get information about users that belong to the local
> >administrators operating system group.
> >
> >I execute the following procedure and got my information:
> >
> >exec master..xp_cmdshell 'net localgroup administrators'
> >
> >The question is that i need to get this information without the NULLs and
> >the output lines that appear.
> >Is it possible? Is there any other way to get the same information?
> >
> >Thanks and best regards.
>

Check OS Users

Hello,
i need to get information about users that belong to the local
administrators operating system group.
I execute the following procedure and got my information:
exec master..xp_cmdshell 'net localgroup administrators'
The question is that i need to get this information without the NULLs and
the output lines that appear.
Is it possible? Is there any other way to get the same information?
Thanks and best regards.You can also try using the following in query analyzer if
the builtin\administrators group hasn't been removed:
exec master..xp_logininfo 'BUILTIN\Administrators',
'MEMBERS'
-Sue
On Wed, 9 Mar 2005 05:09:06 -0800, "CC&JM"
<CCJM@.discussions.microsoft.com> wrote:

>Hello,
>i need to get information about users that belong to the local
>administrators operating system group.
>I execute the following procedure and got my information:
>exec master..xp_cmdshell 'net localgroup administrators'
>The question is that i need to get this information without the NULLs and
>the output lines that appear.
>Is it possible? Is there any other way to get the same information?
>Thanks and best regards.|||> The question is that i need to get this information without the NULLs and
> the output lines that appear.
> Is it possible?
You can use INSERT ... EXEC to insert the results into a table and filter as
needed:
CREATE TABLE #Results(OutputLine varchar(8000))
INSERT INTO #Results
EXEC master..xp_cmdshell 'net localgroup administrators'
SELECT *
FROM #Results
WHERE OutputLine IS NOT NULL AND
OutputLine NOT LIKE '-%' AND
OutputLine <> 'The command completed successfully.'
DROP TABLE #Results

> Is there any other way to get the same information?
Consider using application code rather than Transact-SQL. API's like WMI
are much more robust for this sort of thing.
Hope this helps.
Dan Guzman
SQL Server MVP
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:0DEE4267-7967-4552-8F42-7A8E0E6BCCD6@.microsoft.com...
> Hello,
> i need to get information about users that belong to the local
> administrators operating system group.
> I execute the following procedure and got my information:
> exec master..xp_cmdshell 'net localgroup administrators'
> The question is that i need to get this information without the NULLs and
> the output lines that appear.
> Is it possible? Is there any other way to get the same information?
> Thanks and best regards.|||Thanks Sue,
Best regards.
"Sue Hoegemeier" wrote:

> You can also try using the following in query analyzer if
> the builtin\administrators group hasn't been removed:
> exec master..xp_logininfo 'BUILTIN\Administrators',
> 'MEMBERS'
> -Sue
> On Wed, 9 Mar 2005 05:09:06 -0800, "CC&JM"
> <CCJM@.discussions.microsoft.com> wrote:
>
>

Tuesday, March 20, 2012

Check if a windows/nt user account exists

I have some script which creates/grant priveleges to windows/nt users to DB but i frequently get the message below:

Windows NT user or group '<user or group>' not found. Check the name again.

I understand that this is because the said user/group is indeed not present in the environment I'm running the script (ie. testing and production environment).

But is it possible to have some sort of checking whether the user/group exists in the environment so that I could determine whether or not to call some lines of code?

Not sure if this is possible so i had to ask. c",)

SELECT *

FROM sysusers

will show the users from the current database. There are columns like isntname and isntgroup that will tell you if it is an NT user name or group. There are more than just the normal users, so take a look at what is in that table.

|||

If i'm not mistaken that will only show users already registered for the current database.

I needed to check if a NT user name/group is valid/exists in the environment rather than if it is registered for the current database.

Appreciate your help but i think i need something else or could you expound how would that apply for my objective?

Thanks in advance

|||

What version of SQL Server are you using? You could use SUSER_SID('<your_windows_login_name>' and check for non-null value. But this method depends on your configuration - the SQL Server service account, member server or standalone server etc. So there is no easy way to do this from the database engine.

You could use the ADSI OLEDB provider and perform distributed queries but this depends on your network configuration & whether LDAP is allowed and so on. In SQL Server 2005, you can write SQLCLR function to perform the check but this requires enabling CLR on the server, creating assembly with possibly UNSAFE or minimum of EXTERNAL_ACCESS permissions.

Best is to perform the check outside of the database, filter the list of users and create the logins. Or you can simply perform the error check in TSQL. This is also easier with TRY..CATCH in SQL Server 2005.

|||Thanks, will definitely try to look into these.|||I think i'll just go for the try-catch. Thanks|||Try catch should be fine, but be careful that you don't need speed. Performance will be a bigger concern just catching the error instead of checking for it first.

Wednesday, March 7, 2012

charts in Reporting Services

hey there

Happy New Year to you all.

in RS 2005

in layout tab

I have four columns in my table

col 1 (group on Company)

col 2 (group on application)

col 3 (count on id no) // total field (count/idno) // max/idno)

col 4 (graph) as I want this to show line by line (visual statement)

I read you need to put that max field in to help with graph. in the Y axis Max field

Unfortunately I either didn't read it properly or I am doing something really wrong.

My graph is not showing correctly - eg one line has 2 in it and is showing more than a line that has 227.

call id is in data of the graph

company name is in series of the graph

can someone explain what I am doing wrong please

thanks

jewel

Anyone able to help here would like to see examples of people using these graphs!

Can someone help with some examples they are using?

Is someone using these without writing extra code etc?

cheers

Saturday, February 25, 2012

Chart x-axis

I am trying to create a chart using end_date (parameter) as the x-axis. I
have set up the category group expression as "=Month(Fields!End_Date.Value)"
and this is used for my x-axis. When the report is viewed, it shows January -
September, November, December, then October. The end_date is setup as
datetime datatype. The value and the labels are correct, just in the wrong
order. How can I get this x-axis in the correct order?On Aug 14, 9:08 pm, j_rad <j_...@.discussions.microsoft.com> wrote:
> I am trying to create a chart using end_date (parameter) as the x-axis. I
> have set up the category group expression as "=Month(Fields!End_Date.Value)"
> and this is used for my x-axis. When the report is viewed, it shows January -
> September, November, December, then October. The end_date is setup as
> datetime datatype. The value and the labels are correct, just in the wrong
> order. How can I get this x-axis in the correct order?
Hi,
Try to put the sorting expression of the group =Month(Fields!
End_Date.Value)
with ascending order.
V.|||That worked. Thanks for your help.
"Vinnie" wrote:
> On Aug 14, 9:08 pm, j_rad <j_...@.discussions.microsoft.com> wrote:
> > I am trying to create a chart using end_date (parameter) as the x-axis. I
> > have set up the category group expression as "=Month(Fields!End_Date.Value)"
> > and this is used for my x-axis. When the report is viewed, it shows January -
> > September, November, December, then October. The end_date is setup as
> > datetime datatype. The value and the labels are correct, just in the wrong
> > order. How can I get this x-axis in the correct order?
> Hi,
> Try to put the sorting expression of the group =Month(Fields!
> End_Date.Value)
> with ascending order.
> V.
>

Friday, February 24, 2012

Chart in crystal

I want to put an asterik next to the numbers on the Group axes (i.e. the numbers on the X axis of the chart) or on the data values of the chart.
Any clues?Cant you use text object for this?|||Can't use text box since it is a dynamic chart and the positions of the data values and group axis values change at runtime.|||Couldn't you write a formula and use that in place of your datafield?

Something like

"*" + " " + {table.field} and then place that in your chart?

Don't quote me that this will work, but I like to take a stab at things to see if I can make them work.

Sunday, February 19, 2012

Chart Custom Series Color Problem

We want to use the default palette for all series groups except the first
one, but when we change the bar color of
the first group, all the groups suddenly become the color we set. This works
fine if we change the background for any other group (not the first group).
Is there any way to get around this?
Example:
This makes all of the columns for all of the groups Orange (#FF9933)
=IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "1",
"#FF9933","Transparent")
This works as expected - except it is on the second group.
=IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "2",
"#FF9933","Transparent")
The data that we want to have custom colored has to be the first set.I'm not sure I understand the issue correctly - but the aggregate scope in
the expression seems incorrect. Instead of scoping with the category
grouping, you should scope with the series grouping (assuming there is a
series grouping in the chart).
E.g.:
=IIF( First(Fields!NUM.Value, "chart1_SeriesGroup1") = "2",
"#FF9933","Transparent")
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"debra doty" <debradoty@.discussions.microsoft.com> wrote in message
news:27C5AC1A-8AAC-41A6-BF0B-29FC932AC720@.microsoft.com...
> We want to use the default palette for all series groups except the first
> one, but when we change the bar color of
> the first group, all the groups suddenly become the color we set. This
works
> fine if we change the background for any other group (not the first
group).
> Is there any way to get around this?
> Example:
> This makes all of the columns for all of the groups Orange (#FF9933)
> =IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "1",
> "#FF9933","Transparent")
> This works as expected - except it is on the second group.
> =IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "2",
> "#FF9933","Transparent")
> The data that we want to have custom colored has to be the first set.
>|||Sorry, I copy/pasted my last desperate attempt at getting this to work.
We did use the series grouping scope, it didn't make any difference. In one
report, we group the data by the day of week. The week starts on Sun. We
want all columns in the Sun group to have a backgroud of orange and the rest
of the week to use the default palette. If we make Tues orange this works
fine - but because Sun is the first group, all the columns in all the groups
become orange.
"Robert Bruckner [MSFT]" wrote:
> I'm not sure I understand the issue correctly - but the aggregate scope in
> the expression seems incorrect. Instead of scoping with the category
> grouping, you should scope with the series grouping (assuming there is a
> series grouping in the chart).
> E.g.:
> =IIF( First(Fields!NUM.Value, "chart1_SeriesGroup1") = "2",
> "#FF9933","Transparent")
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "debra doty" <debradoty@.discussions.microsoft.com> wrote in message
> news:27C5AC1A-8AAC-41A6-BF0B-29FC932AC720@.microsoft.com...
> > We want to use the default palette for all series groups except the first
> > one, but when we change the bar color of
> > the first group, all the groups suddenly become the color we set. This
> works
> > fine if we change the background for any other group (not the first
> group).
> > Is there any way to get around this?
> >
> > Example:
> > This makes all of the columns for all of the groups Orange (#FF9933)
> > =IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "1",
> > "#FF9933","Transparent")
> >
> > This works as expected - except it is on the second group.
> > =IIF( First(Fields!NUM.Value, "chart1_CategoryGroup1") = "2",
> > "#FF9933","Transparent")
> >
> > The data that we want to have custom colored has to be the first set.
> >
>
>

Thursday, February 16, 2012

Chart actions produce blue border

When I place a chart in a table group header and specify a hyperlink action, the chart becomes adorned with a blue border. When I take the chart out of the table, the border disappears. The same problem occurs in a matrix.
Is this by design (is this somehow a hyperlink blue)? If so, how do I turn this off.
MaxUnfortunately browsers draw this blue border even if border style is set
None.
As workaround you may try to place rectangle into table or matrix cell, and
then put a chart into this rectangle.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Max" <Max@.discussions.microsoft.com> wrote in message
news:DDCBA9DF-DCBB-4F4A-843C-C128DFABA5F3@.microsoft.com...
> When I place a chart in a table group header and specify a hyperlink
> action, the chart becomes adorned with a blue border. When I take the
> chart out of the table, the border disappears. The same problem occurs in
> a matrix.
> Is this by design (is this somehow a hyperlink blue)? If so, how do I
> turn this off.
> Max
>|||Thanks Lev. This worked.
Good software finds bugs in other software!
"Lev Semenets [MSFT]" wrote:
> Unfortunately browsers draw this blue border even if border style is set
> None.
> As workaround you may try to place rectangle into table or matrix cell, and
> then put a chart into this rectangle.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Max" <Max@.discussions.microsoft.com> wrote in message
> news:DDCBA9DF-DCBB-4F4A-843C-C128DFABA5F3@.microsoft.com...
> > When I place a chart in a table group header and specify a hyperlink
> > action, the chart becomes adorned with a blue border. When I take the
> > chart out of the table, the border disappears. The same problem occurs in
> > a matrix.
> >
> > Is this by design (is this somehow a hyperlink blue)? If so, how do I
> > turn this off.
> >
> > Max
> >
>
>

Friday, February 10, 2012

Chaning login name

There have been some major changes here at work, and in order to keep up we
need to change some of the Group names in Active directory. Will the
changes that are made in Active Directory cascade down into SQL Server?
What is the protocol for this type of change?
Thanks,
DrewNo. On 2005, you can rename a login (to reflect the name change) using ALTER LOGIN.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Drew" <drew.laing@.swvtc.dmhmrsas.virginia.gov> wrote in message
news:OQx$0ftqIHA.5096@.TK2MSFTNGP02.phx.gbl...
> There have been some major changes here at work, and in order to keep up we need to change some of
> the Group names in Active directory. Will the changes that are made in Active Directory cascade
> down into SQL Server? What is the protocol for this type of change?
> Thanks,
> Drew
>|||What is the protocol for SQL Server 2000?
Thanks,
Drew
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:C42BDB9F-51A2-424C-8C25-58B905FB94E4@.microsoft.com...
> No. On 2005, you can rename a login (to reflect the name change) using
> ALTER LOGIN.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Drew" <drew.laing@.swvtc.dmhmrsas.virginia.gov> wrote in message
> news:OQx$0ftqIHA.5096@.TK2MSFTNGP02.phx.gbl...
>> There have been some major changes here at work, and in order to keep up
>> we need to change some of the Group names in Active directory. Will the
>> changes that are made in Active Directory cascade down into SQL Server?
>> What is the protocol for this type of change?
>> Thanks,
>> Drew
>|||You can't change the name for a login in 2000. You'd have to delete and re-create the login...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Drew" <drew.laing@.swvtc.dmhmrsas.virginia.gov> wrote in message
news:%234%233Q7tqIHA.2292@.TK2MSFTNGP03.phx.gbl...
> What is the protocol for SQL Server 2000?
> Thanks,
> Drew
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:C42BDB9F-51A2-424C-8C25-58B905FB94E4@.microsoft.com...
>> No. On 2005, you can rename a login (to reflect the name change) using ALTER LOGIN.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Drew" <drew.laing@.swvtc.dmhmrsas.virginia.gov> wrote in message
>> news:OQx$0ftqIHA.5096@.TK2MSFTNGP02.phx.gbl...
>> There have been some major changes here at work, and in order to keep up we need to change some
>> of the Group names in Active directory. Will the changes that are made in Active Directory
>> cascade down into SQL Server? What is the protocol for this type of change?
>> Thanks,
>> Drew
>>
>