﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TSQL Login &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/tsql-login/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Mon, 13 Jun 2022 20:15:30 +0000</lastBuildDate>
	<language>tr</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>
	<item>
		<title>SQL Server&#8217;da Tüm Login ve Tüm Windows Group Altındaki Tüm Loginlerin Listesini Almak</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-tum-login-ve-tum-windows-group-altindaki-tum-loginlerin-listesini-almak</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Sun, 10 Apr 2022 17:52:01 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Loginlerin Listesini Almak]]></category>
		<category><![CDATA[SQL Server Login]]></category>
		<category><![CDATA[TSQL Login]]></category>
		<guid isPermaLink="false">https://sqlserveregitimleri.com/?p=13537</guid>

					<description><![CDATA[Herkese merhaba, Bu yazıda SQL Server’da tüm login ve tüm windows group altındaki tüm loginlerin listesini almak ilgili bilgi vermeye çalışacağım. SQL Server’da bazı durumlarda...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu yazıda SQL Server’da tüm login ve tüm windows group altındaki tüm loginlerin listesini almak ilgili bilgi vermeye çalışacağım.</p>
<p>SQL Server’da bazı durumlarda tüm login ve tüm windows group altındaki tüm loginlerin listesini almak isteyebilirsiniz.</p>
<p>Aşağıdaki kodu kullanarak siz de bu işlemi rahatlıkla yapabilirsiniz.</p>
<pre class="line-numbers"><code class="language-sql">DECLARE @LoginList TABLE
(
    LoginName NVARCHAR(256),
    [Type] VARCHAR(8),
    [Privilege] VARCHAR(8),
    [Mapped Login Name] NVARCHAR(256),
    WindowsGroupName NVARCHAR(256)
);

DECLARE @WindowsGroupName NVARCHAR(256);

--SQL/Windows Logins

INSERT INTO @LoginList
SELECT name,
       'user',
       'user',
       name,
       ''
FROM sys.server_principals
WHERE type IN ( 'S', 'U' );
DECLARE c1 CURSOR FOR

--Windows Groups

SELECT name
FROM sys.server_principals
WHERE type = 'G';
OPEN c1;
FETCH NEXT FROM c1
INTO @WindowsGroupName;
WHILE @@fetch_status &lt;&gt; -1
BEGIN
    INSERT INTO @LoginList
    (
        LoginName,
        [Type],
        [Privilege],
        [Mapped Login Name],
        WindowsGroupName
    )
    EXEC xp_logininfo @acctname = @WindowsGroupName, @option = 'members';
    FETCH NEXT FROM c1
    INTO @WindowsGroupName;
END;
CLOSE c1;
DEALLOCATE c1;
SELECT LoginName,
       WindowsGroupName
FROM @LoginList;</code></pre>
<p>Yukarıdaki kod bloğunu çalıştırdığınızda aşağıdaki sonucu göreceksiniz.</p>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-13540 size-full" src="https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tum-login-ve-tum-windows-group-altindaki-tum-loginlerin-listesini-almak-1.jpg" alt="SQL Server'da Tüm Login ve Tüm Windows Group Altındaki Tüm Loginlerin Listesini Almak" width="700" height="588" srcset="https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tum-login-ve-tum-windows-group-altindaki-tum-loginlerin-listesini-almak-1.jpg 700w, https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tum-login-ve-tum-windows-group-altindaki-tum-loginlerin-listesini-almak-1-315x265.jpg 315w, https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tum-login-ve-tum-windows-group-altindaki-tum-loginlerin-listesini-almak-1-357x300.jpg 357w, https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tum-login-ve-tum-windows-group-altindaki-tum-loginlerin-listesini-almak-1-161x135.jpg 161w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Görüldüğü üzere tüm login ve tüm windows group altındaki tüm loginlerin listesi alınmış oldu.</p>
<p>Herkese çalışma hayatında ve yaşamında başarılar kolaylıklar.</p>
<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 247</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
