Modifies, by uridylylation and deuridylylation, the PII regulatory proteins GlnB and GlnK, in response to the nitrogen status of the cell that GlnD senses through the glutamine level. Under low glutamine levels, catalyzes the conversion of the PII proteins and UTP to PII-UMP and PPi, while under higher glutamine levels, GlnD hydrolyzes PII-UMP to PII and UMP (deuridylylation). Thus, controls uridylylation state and activity of the PII proteins, and plays an important role in the regulation of nitrogen assimilation and metabolism. [protein-PII]-L-tyrosine + UTP = [protein-PII]-uridylyl-L-tyrosine + diphosphate [protein-PII]-uridylyl-L-tyrosine + H2O = [protein-PII]-L-tyrosine + H(+) + UMP Mg(2+) appears to be the physiologically relevant metal ion cofactor for both transferase and uridylyl-removing activities. Uridylyltransferase (UTase) activity is inhibited by glutamine, while glutamine activates uridylyl-removing (UR) activity. Both reactions are activated by ATP and 2-ketoglutarate, via the binding of these effector molecules to the substrates PII and PII-UMP. kcat is 137 min(-1) for the UTase reaction. kcat is 2.7 min(-1) for the UR reaction in the absence of glutamine, and 6.5 min(-1) in the presence of 2.5 mM glutamine. Monomer. Can also form homooligomers that are much less active. Has four distinct domains: an N-terminal nucleotidyltransferase (NT) domain responsible for UTase activity, a central HD domain that encodes UR activity, and two C-terminal ACT domains that seem to have a role in glutamine sensing. The transferase reaction proceeds by an ordered bi-bi kinetic mechanism, with PII binding before UTP and pyrophosphate (PPi) released before PII-UMP. The uridylyl-removing reaction proceeds with rapid equilibrium binding of substrate and random release of products (PubMed:9737855). Belongs to the GlnD family.